Essay - an attempt to understand the code areas of competence DDD sinking

Today has been a train, have been thinking about the past, many chiefs analysis and articles about the dismantling of the DDD, honest gauge just where such a context, subdomains, aggregate root and so on, these abstract terms like stumbling block as to understand DDD, really think of it mvc, mvvc how easy it is understandable Yeah, that's a very harmonious and enjoyable learning process it.
Well, pull away, and we all know that first of all code written good measure, reusability and cohesion is an integral part of the evaluation factors. Also these two indicators is the ability to guide the code key indicators of the sinking. I am sure you will say that these two indicators are roll melon mess cooked, but I think when a team of technical frameworks mature, the code after the formation of the members of a given type is difficult to find the problem. For example, when the user requests execution of most business users will judge it exists or not, the service will call the user of services (go here or call micro services can be achieved through dao, does not affect the description) to determine the user according to the return, it is not here are all business user actions such judgments, in fact, here we can determine the user exists or not sink directly to the user to do this model, the business side to get the user entity, directly user.isExist () method will be able to judge, semantic very clear, is not it also have a taste point field boundaries? Of course, many students will say we are doing here is just an example, that if they can maintain the judgment of each model layer are so simple, then the reuse of code itself will be a lot of refreshing.
Think about what the nature of reusability and cohesion in the above example which is it? In fact reusability tell us what time of the sinking, and cohesive tell us where we are sinking. There is no cohesive function to the appropriate entity, there is no cohesion to the appropriate level also has two levels
so we can easily find this ability sink strategy step by step should be a more realistic, more agile approach, because we need to recognize that the model is not a design out, but iterative evolution out.
I must admit I did not know what was described above, it seems that a simple code to sink, but for myself I feel like if there is a great harvest, hope can have more such independent thinking.

Published 169 original articles · won praise 224 · views 260 000 +

Guess you like

Origin blog.csdn.net/sureSand/article/details/105353628
ddd