Hmm, IMHO DDD is not so much a "bundle." This is more about modeling the problem you are trying to solve in good shape, so your model (objects, value objects, repositories, services, specifications) reflect the real problem area.
However, there really is some kind of “separation” between the classes you write, but I really haven’t gone as far as calling it “separation”, since IMHO is great for your presentation classes and domain classes such as infrastructure. However, domain classes should not be dependent on presentation classes, for example, but the opposite may be true.
I mainly organize my projects this way:
- a has an assembly containing material associated with the view. (Forms, etc.)
- I have an assembly that contains a "domain". This includes objects, interfaces, specification classes, etc.
- another assembly that contains repository implementations.
- set of infrastructure assemblies:
- a generic 'framework' dll that contains utils that I can use in my presentation, in my domain classes, etc.
- a dll that contains helpers for accessing the database (in my case, a thin shell around NHibernate).
Unlike what Nathan Hughes says, I think it’s normal that your presentation level has access to the infrastructure, as I sometimes omit the “application service level”. In this case, my presentation level is my application. I also use NHibernate, and it is normal for me that my level of presentation appeals to NHibernate helpers. Since my application (in some cases this is my presentation level) is the only "thing" that has knowledge of the application context. So the one who is responsible for starting and completing transactions, for example.
(As Evans says in chapter 5, I think: Context is King).
source share