![]() If you have multiple Aggregates in a Module, but one is not cohesive with the others, it’s time to break it out into its own Module.įor example, in a Discussion Module you might have an Aggregate named Thread. So instead of grouping the code around users under a Users namespace, instead use the word that is directly derived from the Ubiquitous Language, so anyone on the team will understand what this specific Module is used for.Ī Module will typically contain one, or sometimes multiple Aggregates that are highly cohesive. A Module is just as an important concept as any Entity of the application. The Ubiquitous Language of the project should guide and instruct the naming of Entities, Value Objects and Services and so it is no different for Modules. Any member of the team should be able to tell you what role and responsibilities any particular Module should possess, given it’s name.įor example, if an important concept to your Organisation is Identity it makes sense to name the Module that deals with this functionality Identity. The name of the Module should be derived directly from the Ubiquitous Language and should reflect an important concept from the Domain. There are 4 important things to remember when thinking about Modules. The code within a module should be highly cohesive and there should be low coupling between classes of different modules. In PHP this would be a specific namespace that contains all of the related classes for that specific concept. In today’s article we’re going to be looking at the importance of Modules in Domain Driven Design, how to think about them and how to extract the important concepts from the Ubiquitous Language.Ī Module serves as a container for a specific set of classes of your application. Firstly they act as purely a form of code organisation, but secondly they also represent an important concept of the structure of the Ubiquitous Language. Modules are an important concept in Domain Driven Design for a couple of reasons. Namespaces allow you to keep related code under the same “bucket” and prevents name collisions between classes from different vendors. ![]() For example, PHP have the concepts of Namespacing. Most programming language have the concept of self contained modules in one form or another. ![]() What is the difference between a Module and a Bounded Context?.What are Modules in Domain Driven Design?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |