Domain-Driven Design
Ubiquitous language
Layers

Bounded contexts
- The bigger the code base a developer has to work with, the bigger the cognitive load, the more difficult it is to understand the code, and therefore the possibility of introducing bugs and errors in judgement;
- The more developers work on the same codebase, the more difficult it is to coordinate efforts and have a common technical and domain vision of the application.

- The system thus consists of a number of subsystems which can contain subsystems of themselves. At the bottom of such a hierarchy are the analysis objects. Subsystems are thus a way of structuring the system for further development and maintenance
- The task of the subsystems is to package the objects so that the complexity is reduced.
- All the objects having to do with a particular part of the functionality will be placed in the same subsystem
- The aim is to have a strong functional coupling within a subsystem and a weak coupling between subsystems (nowadays known as low coupling and high cohesion)
- [One subsystem] should therefore preferably be coupled to only one actor, since changes are usually caused by an actor
- […] begin by placing the control object in a subsystem, and then place strongly coupled entity objects and interface objects in the same subsystem
- All objects which have a strong mutual functional coupling will be placed in the same subsystem […]
- Will changes in one object lead to changes in the other object? (This is now known as The Common Closure Principle – Classes that change together are packaged together – published by Robert C. Martin in his paper “Granularity” in 1996, 4 years after Ivar Jacobson book)
- Do they communicate with the same actor?
- Are both of them dependent on a third object, such as an interface object or an entity object?
- Does one object perform several operations on the other? (This is now known as The Common Reuse Principle – Classes that are used together are packaged together – by Robert C. Martin in his paper “Granularity” in 1996, 4 years after Ivar Jacobson book)
- Another criterion for the division is that there should be as little communication between different subsystems as possible (low coupling)
- For large projects, there may thus be other criteria for subsystem division, for example:
- Different development groups have different competence or resources, and it may be desirable to distribute the development work accordingly (the groups may also be geographically separated)
- In a distributed environment, a subsystem may be wanted at each logical node (SOA, web services and micro services)
- If an existing product can be used in this system, this may be regarded as a subsystem (libraries our system depends on, i.e. an ORM)
Anti-Corruption Layer
- Adapting subsystems APIs to what the client subsystems need;
- Translating data and commands between subsystems;
- Establish communication in one or several directions, as needed

Comments
Post a Comment