Patterns to model the domain
This section will discuss few tactical patterns, and explain how they represent the policies and logic within the problem domain. They express elements of models in the code, the relationship between the objects and model rules, and bind the analysis details to the code implementation.
We will discuss the following patterns in details:
- Entities
- Value Objects
- Domain Services
- Modules
- Aggregates
- Factories
- Repositories
The following diagram depicts various tactical patterns and their logical flow:

Entities
As stated in the introduction section, an entity is a mutable object. It can change its attributes without changing its identity. For example, a product is an entity, which is unique and won't change its ID (distinctiveness) once it is set.
However, its price, description, and so on, can be changed as many as times it needs to.

The preceding diagram depicts an entity along with an example. An employee ID is unique and never changes. However, there is a contact detail that can...