Search This Blog

Monday, March 17, 2014

14 chapters down one appendix to go

I finished Chapter 14 on the Application of Implementing Domain Driven Design.

We have had the "What should go in a Application Service and what should go in a domain service" discussion here at work many times. At one point, the author claims I am going to clearly answer this question for you. I thought great I won't have to stress about that anymore. I feel like a broken record saying this but ... I was hoping he would give more details in his explanation because it still doesn't seem clear to me. What I got from what the book is that Application Services are for handling transactions and security. If you are doing more than creating an entity and adding it to a repository then you may have a "significant process" that needs to be modeled in the domain. He talked a little about Application Services that are for querying. I couldn't find any rules of thumb though about when your queries have too much business logic and should be domain services themselves. He did mention that sometimes you need to convert your application service into its own bounded context. I can think of one place in our code that might benefit from this idea.

There are no more chapters in the book. There is an appendix about CQRS written by someone else which I plan to read, but for the most part I am done with this book. I can't say I enjoyed reading it. I was really hoping it would answer a lot of questions for me, but I really don't think it did. I did some learn some things but not a whole lot. I guess the author's writing style just doesn't fit with how I learn. He probably knows a lot of stuff that can help me, but whatever reason I just didn't get that information from this book.

Tuesday, March 11, 2014

Bounded Context Integration

I finished Chapter 13 on Integrating Bounded Contexts of Implementing Domain Driven Design.

In our domain everything is jumbled together in one giant bounded context. Having never done what the author describes I found this chapter very interesting.

I liked the discussion about messaging. I had never thought about messages arriving out of order. I thought the author came up with a very simple solution to what could be a very complicated problem.

I also liked the discussion where he modeled a long running process as an entity and setup trackers to do automatic retries. I had to do something similar with a third party service our application integrates with. The code I wrote was very specific to the one area I was working on though. If you did this type of integration in multiple places in your application, then I could see that having more generic reusable components could be very helpful.