site_logo

Domain driven design

Updated at: 7 October 2024

## Domain driven design
Domain driven design
**Domain driven design (DDD)** is an approach to application development based on domain allocation (domain).
important3
## Domain Domain is the area of knowledge/activity for which the application is being developed. It is clear that lawyers have their own terms and important concepts, which are different from the words used in the oil and gas industry. And these are not just words, they reflect important processes and connections for the customer. That is why it is important to pay attention to the terms that are used in this field. This is ensured by constant communication between the two parties - application developers and customers. This approach reflects the main principle of DDD - development should not be in isolation from business objectives. DDD is not an instruction or methodology, but a set of rules and guidelines.
For small and uncomplicated software products DDD, like other architecture design principles, is not so important. But narrow subject areas with complex specifics require careful thought at the highest level. DDD suggests creating subject area models that contain complex business logic. ## Model A model is a system of abstractions that describes the individual characteristics of a domain. Like a physical model that simplifies the understanding and study of an object, it helps to solve problems related to a given domain. ## Domain Modeling Domain modeling is a technique used in software development, particularly in the context of domain-driven design (DDD), to represent the basic concepts, rules, and relationships in a particular business domain. ## Aggregate Aggregates are associations of entities and value objects with clearly delineated boundaries. You can think of an aggregate simply as a group that allows you to refer to all the elements within it at once. For example, instead of making the command "slice apple" and repeating it n times, you could aggregate all apples into the group "apples" and apply the command "slice" to that group. ## Service Services are functions that are not attached to entities or value objects. Roughly speaking, an action in itself. ## Repositories Repositories are services that use a global interface to provide access to all entities and value objects that reside in a particular group of aggregates. For example, we can consider the "cut" command to be a repository when it is applied to the "fruit" aggregate group, which includes the aggregates "apples", "pears", and "bananas". Using the "Domain driven design" approach when designing software architecture and complex corporate information systems makes it easier to maintain changes in the project and more efficient to test new releases.