[Architecture design] DDD Experience Sharing (medium)

Source: Internet
Author: User

Connection...

[Architecture design] DDD Experience Sharing (Part 1)

 

System Analysis stage (SA)

In the system analysis phase, the main task is to propose a solution to the customer's needs and analyze the system architecture. Generally, UML configuration diagrams, Suite diagrams, and other tools are used to complete system analysis. Finally, we will organize the designed solution into a "System Requirement Specification 」.

 

The system analysis stage involves a lot of complicated tasks, and it can even be said to be an out-of-the-box creation process. Experienced developers usually do not know how to enter this stage. In this case, we can cut the work in the system analysis stage into different perspectives for analysis and design. This is also called the "view method 」. The view method is used to analyze and design the entire system architecture and determine the software hierarchy and functional modules required by the system architecture.

 

At the same time, the domain model generated in the analysis and design demand analysis phase is encapsulated and transformed into functional modules in the system architecture. Take this function module as the center, and then analyze and design other function modules in the entire system architecture. After the entire system architecture is established, the "system analysis phase" should be completed.

 

System Analysis Phase (SA)-Five Views

This topic uses the "Five Views" view method to divide different analysis and design work in the system analysis phase. For more information about the five views, see Software Architecture Design-Wen Yi. Next, we will analyze and design the entire system architecture through the five-view method to complete the relevant design work in the system analysis phase.

 

Physical Architecture

The physical architecture is oriented to clarify the entire solution, Integrated Device devices and online methods. The collected data is analyzed and organized using the "UML configuration diagram. By analyzing and designing the physical architecture, you can describe the physical environment of the entire solution and define the scope of the entire solution.

 

For example, it is the physical architecture data of an Access Control Server. The figure shows the entire access control system solution: an ACS server, a reader, and a database used to store data ). In addition, the ACS Server communicates with the card reader through RS485, while the ACS server uses TCP/IP to communicate with the database.

 

Logical architecture

The logic architecture is oriented to clarify the entire solution, and all the software systems that should be developed or integrated. Complete Architecture Analysis and Design for software systems that should be developed or integrated. The Analysis and Design of the entire logical architecture can be divided into the following steps:

 

Logical architecture-subsystem Design

The sub-system design step is to analyze and design the system according to the physical architecture, and decide to cut the system into several sub-systems. The collected data is analyzed and organized using the "UML suite diagram. By analyzing and designing the subsystem, you can describe the software system that the entire solution should complete and further define the scope of the entire solution.

 

Since then, it is an Access Control Server Subsystem design data. The figure shows the entire access control system solution: the reader and database do not need to be developed and the existing system must be used. On the ACS server, an Access Control Server system needs to be developed.

 

Logical architecture-hierarchical design

The hierarchical design step is to analyze and design each subsystem and decide how to cut the software hierarchy. In this step, I usually apply a common three-tier architecture directly to complete the hierarchical design step. The reason for choosing a three-tier architecture is also very simple, because it is the most familiar architecture among my team members. That is to say, you should select an applicable Hierarchical Architecture Based on the development team or solution considerations.

 

Since then, it is a typical three-tier architecture. Presentation layer is responsible for interacting with customers. The data access layer is responsible for interacting with external systems. The business layer is a part of the system logic except the two listed above.

 

Logic architecture-Module Design

The module design step is based on the "Domain Model" produced in the "demand analysis phase. First, the core functional modules should be designed based on the domain model and distributed to software layers. Then, analyze and design the functional modules that are missing in the software hierarchy, and sort out the functional modules that are not included in the core functional modules.

 

Since then, it is a module design data of an Access Control Server. It is a simple domain model generated in the demand analysis phase, which is directly encapsulated into the core function module of the business layer. Note that if the solution contains a large number of Domain Models, You can classify them by function or purpose and divide them into multiple functional modules.

 

When we analyze and design the core functional modules of the business layer, we can easily design the corresponding modules in the presentation layer and data access layer analysis. For example, the presentation layer does not have any functional modules, So we add a functional module (ACS. Gui) to interact with users ). Because the system needs to use RS485 to communicate with the card reader, add a function module (ACS. messaging) to the data access layer to communicate with the card reader ). Finally, some data in the system must be stored in the database, so that the data access layer is added to the functional module (ACS. Data) that communicates with the database ).

 

Logical architecture-Architecture Design

After the analysis is designed, the entire solution is split and disassembled. However, only separated and disassembled, and the final design result will only be fragmented architecture design data. In this case, we need to combine the architecture design step to analyze the interaction process and interface between each functional module, and add key architecture models. These designs are used to integrate each independent functional module. When all functional modules are finally integrated, the "logical architecture" should be done.

 

Since then, it is an Access Control Server architecture design data. The IOC design mode is added between the core function module (ACS) and the communication function module (ACS. messaging. This IOC mode defines how two modules interact and the dependency between modules.

 

When all functional modules are fully integrated, you can also sort out dependent data between functional modules.

 

Operating Architecture

The runtime architecture is oriented to the analysis and design of the entire system architecture, to determine whether to add a multi-thread design, and to design a communication model for the execution threads between functional modules.

 

Since then, it is the operational architecture design data of an Access Control Server. It defines that when the messagingclient class receives multiple execution threads from the outside, it first encapsulates the operation as a delegate and submits it to the UI execution thread (synchronizationcontext) for execution. To design the system in this way, the systems except messagingclient do not need to consider the thread safety-related design, because they all operate in the same UI execution thread (synchronizationcontext.

 

Data Architecture

The orientation of data architecture is to analyze and design the system based on the entire system architecture, determine the database to be used by the system, and design whether the database requires a backup mechanism and distributed processing. It also determines which configuration files should be used by the system, and designs the location of the file deployment, as well as the content format and other related topics. In addition, if the system has distributed design requirements, you can also perform analysis and design at this stage, and modify the decisions and design made in the previous stages when necessary.

 

Development Architecture

The final analysis design of the "system analysis stage" is to determine the development rules. For example, version management rules, project management rules (project name, archive structure), program code writing rules (namespace, naming rules, exception handling, log management. These development-related rules will greatly affect subsequent production and future maintenance costs. Early standardization and design can greatly reduce project costs and risks.

 

To be continued...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.