Aggregate Root
Learn about the main aggregate in a domain layer called aggregate root and how to implement it.
We'll cover the following
Let us imagine there are many aggregates in the domain. They have different functionalities that can be used to achieve use cases. When it is necessary to carry out a particular use case, it will be difficult to discover what the access point should be, what aggregate should be executed at first. Therefore Domain Driven Design extends the concept of aggregate and creates a new artifact called aggregate root.
What is an aggregate root?
Similar to a normal aggregate, an aggregate root is a cluster of objects that can have entities, values objects, or even other aggregates. The main difference between them is that an aggregate root is the main aggregate. It means everything outside of the domain layer boundary must use business logic by interacting with the aggregate root. The aggregate root should in turn orchestrate logic in other aggregates, value objects, and entities.
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy