当前位置:网站首页>Domain Driven Design
Domain Driven Design
2022-07-22 17:23:00 【fpcc】
One 、 Domain-driven design
As mentioned earlier , Domain driven design is actually business driven design , It's just that the business is more straightforward , The domain is more abstract . Domain-driven design , In fact, it is to refine the actual business scenario , Then through experts and design in this business field 、 Developers use a common language , Discover and generate domain concepts , Abstract the domain model that reflects the real world . This is often referred to as domain oriented thinking .
There are two major steps in Domain Driven Design :
1、 Abstract the domain model from specific business
2、 Driven by domain model to complete software code design and development .
In fact, Domain Driven Design didn't produce much water flowers at the beginning , At least at home , Just with the rapid development of mobile Internet in recent years , People see some of the mysteries , Only gradually pay attention to it .
Two 、 The idea and core of Domain Driven Design
The idea of domain driven design is to have domain thinking , We should be able to use the idea of the field to guide the transformation of the entire business requirements to software design . let me put it another way , Have a higher level of understanding of the business , Instead of just understanding the business , The so-called higher-level cognition , Is the abstract . therefore , The core of domain driven design is MDD, That is, model design . A good model designed in a common language , It can better let people in all links of the whole program actively participate , And can better remove some “ noise ”. therefore , The domain layer is the essence of the model .
So what is the domain ? We can understand the boundary of molding business , The overall context of granular business . So the depth of understanding of the field , Determines the advantages and disadvantages of domain driven design , It also determines the elasticity and scalability of model generation . This is also the most common principle and means to separate domains and form domain hierarchies in domain design .
3、 ... and 、 Application of Domain Driven Design
Domain driven design can be divided into two parts from two higher levels :
1、DDD Strategic level design
The strategic focus is to decompose and control the problem space and the two directions of the reconciliation space .
2、 Design at the tactical level
Tactics are designed in the restricted environmental context and boundary within the specific subspace limited by the strategy .
The design of strategy and tactics is dialectical , Don't say much about this .
When designing a domain model , Generally, there are the following steps :
a、 Create a preliminary domain model based on actual requirements , And according to specific fields and related relationships , Describe it in common language ;
b、 Classify the whole application layer according to actual functions , And further divide the application layer and domain layer ;
b、 Segment domain model , Divide entities , Values and objects , And domain services ;
f、 Analyze the relationship in the field , Remove noise ;
e、 Find the boundary to aggregate and determine the aggregation (AGGREGATE) root , This needs continuous practice and summary ;
f、 Determine the design allocation and interface control of aggregation root and warehouse ;
g、 Check the adaptability between the scene and the domain model of the design and constantly improve ;
h、 Consider how domain entities or values are built ( Directly or using the factory );
i、 Constantly iteratively reconstruct the domain model , Constantly improve and modify the domain model .
Four 、 summary
You can see it here , In fact, domain driven design is the abstraction of specific business scenarios , It is the abstraction under the continuous subdivision of different businesses . In the present , I want to build a middle office to handle all businesses , It looks beautiful , In fact, it is contrary to reality . Maybe , At some point in the future , With the evolution of technology and the improvement of ideological ability , It is possible to achieve this grand goal . But that is another matter .
Tell the present story , Say business now , Seeking truth from facts .
边栏推荐
猜你喜欢
Application of workflow engine in vivo marketing automation | engine 03
How to implement Apache's built-in AB stress testing tool
Write a sequencer plug-in sequence subtitle (1)
Server network performance tuning cases
了解 5 种流行的 NFT 投放方式及其优缺点
UE4 set night (update skysphere according to directionallight direction)
UE4 combines the objects made by the brush into a whole
Take it. The strongest "high concurrency" system design 46 consecutive questions, killing a crowd of interviewers every minute
Share our first otherside trip
Go语言学习日记【三十一】golang与pgsql交互
随机推荐
服务器网络性能调优工具
DP子序列系列问题
注意力机制的分类
UE4 level blueprint realizes door opening and closing
ACL和NET
UE4 key to open the door
How to solve the problem of uncontrollable win11 flashing white screen?
力扣刷题:dfs递归解决二叉树剪枝
Take it. The strongest "high concurrency" system design 46 consecutive questions, killing a crowd of interviewers every minute
服务器网络性能调优案例
STL map
Win11 terminal administrator cannot open the solution
UE4 create a project
[pictures and texts] detailed tutorial of online one click reinstallation of win7 system
UE4 modify the default cache path
Activity recommendation | Apache pulsar's exploration and practice in vivo will be broadcast soon
UE4 set night (update skysphere according to directionallight direction)
Share our first otherside trip
Tensorflow predicts daily sales
Causes of server buffer/cache and buffer/cache release