What do you recommend as the proper project structure for a WebForms solution that is utilizing NHibernate and trying to bring in some DDD concepts?
Assuming the root namespace and solution name is Sample
What am I forgetting? Is there a more standard way to name these?
Any great blog posts on the topic?
An aggregate is a domain-driven design pattern. It's a cluster of domain objects (e.g. entity, value object), treated as one single unit. A car is a good example. It consists of wheels, lights and an engine.
DDD patterns help you understand the complexity in the domain. For the domain model for each Bounded Context, you identify and define the entities, value objects, and aggregates that model your domain. You build and refine a domain model that is contained within a boundary that defines your context.
Domain-driven design (DDD) is a useful approach that provides excellent guidelines for modeling and building systems, but it is a means to an end, not an end in itself. While the concepts are valid, you lose a lot if you limit yourself to using them only: There actually is a life beyond DDD.
Domain-Driven Design(DDD) is a collection of principles and patterns that help developers craft elegant object systems. Properly applied it can lead to software abstractions called domain models. These models encapsulate complex business logic, closing the gap between business reality and code.
A few parts missing seem to be a central location for services needed throughout the solution and test projects. I usually have something like this:
I have a matching tree of test projects:
Of course, the tree will get more complex depending on the project. As for discussions, check out the Onion Architecture. You can also check out the sample projects on Domain-Driven Design and see what you can take from those.
I keep it simple and lean towards segregating by namespace rather than by project, especially at the beginning. I usually start with three projects in the solution:
I have found everyone has their own preferences for naming, I prefer:
Ben Scheirman also recently posted about this: Exporting Visual Studio Solutions with Solution Factory.
He uses a different structure but also includes a great way to standardize your template.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With