当前位置:网站首页>Layered architecture of DDD

Layered architecture of DDD

2022-06-12 02:10:00 I'm a loser

DDD As a guiding ideology , There are still some things that can be landed relatively , For example, his layered architecture , The whole is divided into the following four layers :

 Insert picture description here
Actually based on the above figure , We can make our project engineering documents more specific , Fill in the picture above
 Insert picture description here

User interface layer (user interface): The user interface layer is responsible for displaying information and interpreting user instructions to users . The users here may be : user 、 Program 、 Automated testing and batch scripting and so on ( In fact, I think it is the layer where we provide services to the outside world .)

application layer (Application): Look at the information and say that there is no business logic here , Generally, it is the channel of microservices and the aggregation of multiple domains or services .

according to DDD Principles , The application layer should be as simple as possible , Does not contain any business rules or knowledge , Only coordinate tasks for domain objects in the next layer , assign jobs , Make them work together , This is shown in the code as Application Generally, there are no conditional judgment statements in the layer . In many projects ,Application Layers will be selected as parcel transactions ( The code enters this layer and the transaction starts , Exit this layer transaction commit or rollback ) The carrier of .

Domain layer Domain: The domain layer is the core of business logic , The domain layer mainly reflects the business capabilities of the domain model , It's used to express business concepts 、 Business status and business rules .
The domain layer contains aggregation roots 、 Entity 、 The value object 、 Domain objects in domain models such as domain services .

Responsible for implementing business logic , Express business concept , Processing business status information and business rules , This layer is the focus of the whole project .

Base layer infrastructure: Some of our basic facilities , It has nothing to do with business , database , middleware , gateway , File systems are third-party tools .

原网站

版权声明
本文为[I'm a loser]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/163/202206120207501979.html