Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the DDD hierarchical architecture

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article introduces the knowledge of "what is the hierarchical architecture of DDD". In the operation of practical cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

As a software development method, DDD (Domain DrivenDesign) can help us to design high-quality software models. In the case of correct implementation, the design we complete through DDD is exactly how the software works. UL (Ubiquitous Language, Universal language) is a language shared by the team and is one of the most powerful features in DDD. Regardless of your role in the team, you will use UL as long as you are a member of the team. Because of the importance of UL, it is necessary to make each concept clear and unambiguous in its own context, so DDD proposes the pattern BC (BoundedContext, bounded context) in strategic design. UL and BC constitute the two pillars of DDD, and they complement each other, that is, UL has its definite contextual meaning, and each concept in BC has a unique meaning. A business domain is divided into several BC, which are integrated through Context Map. BC is an explicit boundary within which domain models exist. A domain model is a software model about a particular business domain. In general, the domain model is implemented through the object model, which contains both data and behavior, and expresses accurate business meaning. In a broad sense, a domain is what an organization does and what it contains, representing the entire business system. Since "domain model" includes the word "domain", we might think that a single, cohesive, and fully functional model should be created for the entire business system. However, this is not our goal of using DDD. On the contrary, the domain model exists in BC. Mode 1: four-tier architecture

Eric Evans proposes the traditional four-tier architecture model in his book "Domain-driven Design-the solution to Software Core complexity," as shown in the following figure:

User Interface is the user interface layer (or presentation layer), which is responsible for displaying information to the user and interpreting user commands. The user here can be another computer system, not necessarily the person who uses the user interface. Application is the application layer that defines the tasks to be accomplished by the software and directs objects that express domain concepts to solve problems. The work that this layer is responsible for is of great significance to the business and is also a necessary channel to interact with the application layer of other systems. The application layer should be as simple as possible, do not contain business rules or knowledge, but only coordinate tasks, assign work, and make them cooperate with each other for the domain objects in the next layer. It does not reflect the state of the business, but it can have another state that shows the progress of a task for the user or program. Domain is the domain layer (or model layer), which is responsible for expressing business concepts, business state information, and business rules. Although the technical details of keeping the business state are implemented by the infrastructure layer, the state that reflects the business situation is controlled and used by this layer. The domain layer is the core of the business software, and the domain model is located in this layer. The Infrastructure layer is the basic implementation layer, which provides general technical capabilities to other layers: passing messages for the application layer, providing persistence mechanism for the domain layer, drawing screen components for the user interface layer, and so on. The infrastructure layer can also support the interaction pattern between the four layers through the architectural framework. The traditional four-tier architecture is a restricted loose hierarchical architecture, that is, any upper layer of the Infrastructure layer can access this layer ("L" type), while the other layers follow the strict hierarchical architecture.

The User Interface layer is mainly Restful message processing, configuration file parsing, and so on. The Application layer is mainly multi-process management and scheduling, multi-thread management and scheduling, multi-co-program scheduling and state machine management, and so on. The Domain layer is mainly the implementation of the domain model, including the establishment of domain objects, the life cycle management and relationships of these objects, the definition of domain services, the publication of domain events, and so on. The Infrastructure layer is mainly business platform, programming framework, encapsulation of third-party libraries, basic algorithms, and so on.

This is the end of the content of "what is the DDD hierarchical Architecture". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report