We are talking about the field-driven design.

Source: Internet
Author: User

The core idea of domain-driven design is to focus on developersProgramThe program implementation and familiarity with domain knowledge are not considered. The design focuses on the field, and the development focuses on the model. The previous tasks were analyzed in the field, and the current purpose is to analyze and develop fields. In this way, the developed software truly serves the domain. The following are some of my summary points.

First, we need to develop software for specific fields. Software architects and system analysts are not very clear about the field, let alone programmers. Only field experts are truly familiar with this field. To keep developers away from the model, the participants include development experts, field experts, and developers. A better way of communication is to create small graphs. Each small graph represents a subset of the model and adds some text annotations. The text will explain some actions and constraints that cannot be presented in the graph. These images can be hand-drawn, meaning they can be changed at any time.

Second, we have to talk about the basic elements of model design. There are hierarchical architectures, entities, value objects, factories, resource libraries, services, and modules respectively. The idea of layered architecture is to divide the system into four layers: UI Layer, application layer, domain layer, and infrastructure layer. The UI Layer is of course the display of the interface, and the application layer is a very thin layer. The main function is to transform the requirements of the UI Layer to the domain layer. This layer conversion is necessary. The UI Layer focuses on the interface design, and the domain layer only on Domain Modeling. The application layer becomes the manager of the business logic and supervises and coordinates the entire application activity. The domain layer naturally focuses on domain construction. There are many such aspects. The following will be involved. The infrastructure layer includes some storage devices, such as databases, XML, and files. An object is a uniquely identified object. Value objects do not need to be uniquely represented. They can be used to complete functions or serve other objects. A factory is the process of separating objects. For example, the creation process of some objects or value objects is complicated, and the factory is required to encapsulate the creation process. A resource library is a container that manages object objects, including persistent object classes and cache object classes. If the domain involves multi-object intertwined functions, you need to create a service to organize such activities in a unified manner. It is a bit like facade mode. However, this kind of organization is different from the application layer. It is also the design of the domain layer. When there are many models, it is necessary for us to distinguish the models from high cohesion and low coupling, so that we have a module.

Third, the domain model has been set up, and the rest is the implementation model. What often happens during the development process is that the model is useless in the later stages of development. So how can we ensure the consistency of the model. This is also very important. If the system is large, the system is divided into different subsystems for modeling. There are several modes available, sharing the kernel, customer-supplier, and independentCubeOpen host mode. The shared kernel has an intersection between the two subsystems and must be maintained. If changes to the intersection are involved, they must be discussed and approved by both parties before they can be changed. The customer-supplier model involves real-world problems and must be sure that the supplier is willing to provide services to the customer. The independent method is applicable to the relative and independent subsystems. The open host mode mainly considers the object of a common service or other services. Defining the isolation layer is cumbersome and not conducive to changes. Therefore, we adopt the form of publishing services. There is also an application on the crash layer, which is applicable to the scenario where the underlying system structure is chaotic and the upper layer needs to be used. It is a facade mode. Continuous integration is required to maintain model consistency.

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.