Chapter 8. Strengthening the Source Code with Domain Knowledge
Once the system has been technically stabilized, we can turn to tactical Domain-Driven Transformation. This involves strengthening our legacy software with domain knowledge. Of course, there is domain knowledge in all legacy software, but it is often hidden under a lot of technology and is inconsistent.
This chapter shows different measures, how to free domain knowledge from technology and inconsistency, and how to make it more explicit, and thus bring it to light. We also discuss which domain-driven refactorings (which are for easier reference described in the appendices) can support these measures.
In Chapter 5 we discussed two basic principles of modular architecture: cohesion and coupling. With the help of these two criteria, the measures for strengthening the source code with domain knowledge can be well located. Together with two higher-level measures, this results in the following classification:
-
Separate business and technical source code
-
Increase cohesion
-
Enrich modeling with domain knowledge
-
Utilize value objects
-
Introduce domain-oriented preconditions
-
Make domain identity of entities explicit
-
-
Reduce coupling
-
Introduce ID references at aggregate boundaries
-
Reduce inheritance in business source code
-
Use domain events for decoupling
-
-
Document and check architecture in code
All these measures of strengthening the source code with domain knowledge lead us to refactor the source code. ...