Bounded Context
People always try to build a unified model, a consistent description. the consistency shown by the laws of physics is a relatively successful example. most people believe that there is an ultimate theory in nature to describe the nature of the universe. the history of physics, that is, constantly approaching the history of this ultimate theory, is constantly being unified by new and more consistent theories of independent and conflicting theories. for example, cutting-edge physicists are currently committed to unifying the four forces of nature: Strong, weak, electromagnetic force, and gravity. at present, there are theories that can unify the first three types, leaving only gravity free.
Inspired by this, many developers also believe that there is a unified model in the business field of an enterprise. Once we find this model, the code will become simple and consistent and easy to understand.
It sounds reasonable. Let's take a closer look at this.
The ultimate theorem of the universe has not yet been found, while Newton's Law and Maxwell's electromagnetic equations have been found to have limitations in more microscopic fields. if the LHC-hit neutron does prove faster than the speed of light, the premise of the Theory of Relativity will no longer exist, so the conclusion will be highly suspected. that is to say, they are not the final model. however, this does not prevent us from developing technologies and creating new tools to solve various problems in our lives. that is to say, even if we rely on an imperfect theory, we can work well. the key here isEffective scope of TheoryA typical example is GPS. If GPS is designed based on the classical theory, there will be a large error. Considering the relativity effect, the error can be reduced to an acceptable range.
What happened in the field of software development is also similar. I have read reports that there was a trend (or an example) A few years ago, that is, some enterprises tried to build a unified model for their own applications, and the results were just like the Unified Process of physical laws, despite all the hardships, it is almost impossible to reach the goal. on the contrary, we have established our own local models for a specific subdomain, but we have tried to map models in Inter-Domain Communication, which actually solves the problem.
This is the bounded context of pragmatism.
Model-dependent Realism
People always try to establish an essential model, an objective description. the objectivity shown by the laws of physics is shocking, and the church is now at the same time for cobeni and Galileo. most people believe that there is an objective theory in nature to describe the nature of the universe. this is called a decision-maker. for example, deterministic physicists are currently working to reconcile the irreconcilable contradiction between relativity and quantum mechanics because they really do not like the uncertainty of quantum mechanics.
Developers do not like uncertainty either. They believe that there is an essential model in a specific business field. Once we find this model, the code will become simple and consistent and easy to understand.
It sounds reasonable. After all, software modeling is a macro world, away from an uncertain microview world. Let's take a deeper look at the ideas of a larger range of physicists.
In a recently published <big design>, Hawking proposed the dependence model truth: "The naive viewpoint of authenticity is incompatible with modern physics. In order to deal with such contradictions, we will adopt a realistic method called dependency model. It is based on the concept that our minds construct a world model to explain inputs from the senses. When such a model successfully interprets an event, we tend to associate the character of reality or absolute truth with it and form its elements and concepts. However, when modeling the same physical scenario, there may be different methods. Each method uses different basic elements and concepts.If both of these physical theories or models accurately predict the same event, one model cannot be more real than the other, which model is more convenient for us to use?"
There are not a few physicists with such ideas. in terms of practicality, it works well. it is also in line with another statement we are more familiar with: the model itself has no advantages or disadvantages, unless they are placed in the context of the same problem. in other words, the model is determined by the problem at hand, rather than something inherently objective.
For example, how to create a chair in a cinema? If the check mark is used as the base, it is entity. If the check mark is not used, it is the value object.
Any domain has a model, but the model is not an essential thing, but completely determined by the needs or usage, that is, the model is determined by the usage of the system.
This is also in line with the Dependency inversion principle: the interface should not be determined by the lower-layer module, but by the abstraction defined by the problem domain. In fact, the interface definition is the embodiment of the model.