In the Evan's DDD book he speaks of segregating concepts in the domain with "modules". The term "module" can be translated to a number of different things in software development, both conceptual and concrete, so I'm wondering how would this concept of DDD modules be expressed in a C#.NET system and if there is any direct correlation to other uses of the term "module" in software development (For example, Evans mentions that some developers express DDD modules as Java packages which I think would be analogous to .NET assemblies).
I think, you could probably express this concept literally with separate .NET assemblies or perhaps with namespaces (which is kind of what we're doing now). We are planning to reduce the number of projects within our solution to improve build time so I'm really interested in how this concept could be applied to a single assembly.
A Module serves as a container for a specific set of classes of your application. In PHP this would be a specific namespace that contains all of the related classes for that specific concept. The code within a module should be highly cohesive and there should be low coupling between classes of different modules.
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.
“Domain-driven design (DDD) advocates modeling based on the reality of business as relevant to your use cases. In the context of building applications, DDD talks about problems as domains.
Modern Software Architecture with Domain Driven Design (DDD). Introduction on DDD and its relation to Microservices, Reactive Systems, BPM, Agile, CQRS and Event Sourcing.
You already answered your own question. That you use either projects or namespaces as a logical separation of modules. You can also use the break down of projects on their type to imply meaning also, as in web services projects are exposed modules vs internal ones etc.
Personally I am a fan of using actual projects and later if the number of DLLs is ever an issue to condense it using ILMerge in my production builds, of course my solution is only around 30~ projects at the moment.
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