In DDD i struggle to understand whether or not my domain is split correctly into aggregate roots and then those aggregate roots are grouped correctly into bounded contexts. is there a way - like a set of rules/guidance i can use to decide whether or not i am placing things in the right AR/BC
|
|
I think Udi Dahan gives a fantastic answer on DDD and creation of aggregate roots: http://www.udidahan.com/2009/06/29/dont-create-aggregate-roots/ As stated by @Malvolio you need to figure out what problem you are trying to solve then decided on how the situation maps back to the real world. Once you have this then the aggregate root will become clear and obvious. |
|||
|
|
|
They say that experience is the worst teacher because you get the test first and the lesson afterwards. Your design decisions are ratified when the problem changes (or your understanding of the problem changes) and you don't have to rip out huge chunks of code and start over. Of course, by then it's too late. The best you can do proactively is ask yourself two questions:
|
|||
|
|
|
My suggestion: don't design the aggregation roots, keeping refactoring the model and the aggregation roots will show themselves. When developing the system, you'll notice that some related entities are always being changed together, then you know they belongs to the same aggregation root. |
|||
|
|