DDD - Domain Driven Design - Tactical Design

What is Tactical Design ?

Reading Time: 3 minutes

In the previous article, I approached the DDD Strategic Design, in this article we will talk about the Tactical Design that is as important as having a deep understanding of the Strategic Design.

The Tactical Design, is a set of technical resources used in the construction of your Domain Model, these resources must be applied to work in a single Bounded Context.

When the Tactical Design standards are used correctly you can actually enrich your Domain Model, which consequently will reflect your business with clarity.

Tactical Design With Building Blocks

The Tactical Design helps us create an elegant Domain Model using Building Blocks, see below the main Building Blocks:

Entities

An Entity is a potentially changeable object, which has a unique identifier. Entities have a life of their own within their Domain Model, which enables you to obtain the entire transition history of this Entity.

Value Objects

What differentiates a Value Object from an Entity is that, Value Objects are immutable and do not have a unique identity, are defined only by the values of their attributes. The consequence of this immutability is that in order to update a Value Object, you must create a new instance to replace the old one.

Aggregates

It is one of the most important and complex patterns of Tactical Design, Aggregates are based on two other Tactical Standards, which are Entities and Value Objects. An Aggregate is a Cluster of one or more Entities, and may also contain Value Objects. The Parent Entity of this Cluster receives the name of Aggregate Root.

Services

Services are stateless objects that perform some logic that do not fit with an operation on an Entity or Value Object.
They perform domain-specific operations, which can involve multiple domain objects.

Repositories

Repositories are mainly used to deal with storage, they abstract concerns about data storage. They are responsible for persisting Aggregates.

Factories

Factories are used to provide an abstraction in the construction of an Object, and can return an Aggregate root, an Entity, or an Value Object. Factories are an alternative for building objects that have complexity in building via the constructor method.

Events

Events indicate significant occurrences that have occurred in the domain and need to be reported to other stakeholders belonging to the domain. It is common for Aggregates to publish events.

Modules

Modules are little mentioned by the developers, however, their use can be very interesting.
Modules help us segregate concepts, can be defined as a Java package or a C# namespace, and always follow the Ubiquitous Language.


You need to understand that not all of these concepts need to be applied to your Domain Model, you need to do an analysis so that it does not add unnecessary complexity to your project.

See you soon!

Buy Me A Coffee

Leave a Comment

Your email address will not be published. Required fields are marked *