views:

78

answers:

1

In the context of DDD how is everyone physically structuring their files/folders when it comes to bounded context and aggregate roots?

Does there need to be a physical representation of these or is it more just for discussions? I've tried to find evans and nilsson say something about physical layout but either I missed it or they don't discuss it.

I'm assuming you can't really represent bounded context in a physical layout as certain classes may be involved in multiple bounded contexts, but it still asks the question of aggregates and how you lay them out.

A: 

(I'm assuming you are talking about project/source/package layout, not about deployment and distribution of production components.)

Different bounded contexts should definitely be in separate packages and possibly separate sub-projects, otherwise I think it is too difficult (subjectively, I'd even say it's impossible) to really maintain the boundary. As for the classes that are involved in multiple bounded contexts, if it does not make sense to factor out the common ground, sometimes all you can do is to minimize the area of contact (probably by constraining use of classes from foreign contexts to the translation layer).

pmf
When you say "package" I'm assuming that's a folder? The terminology is a little different between java/.net.
Sean Chambers
Sorry, I just looked up that a package is equivalent to a namespace in .net. Thanks!
Sean Chambers