This is the most commonly used technique. Will be a big problem, the continuous dismantling for the various small problems analysis and research, and then put together. In the west is called the Divide and Conquer Principle (the principle of divide and rule).
in the structured programming era, advocating modular (Modularization). Component Software (Based), which is the first to put forward software complexity, is proposed. Do not know whether it is inspired by the Lego building blocks, the system will be split into different components, each implemented, and then assembled together.
in the architecture design, whether it is C/S style, layered,Or N-Tier, SOA, and in front of the component is the same, they are more emphasis on the combination of interaction. Design, sub division of responsibilities, a good interface, you can develop their own. Then the interaction is limited to the interface layer, which can control the complexity of the whole system.
such as the application layer using a speech database (speech library, a library of modular applications), there is no need for concern for the internal implementation, as long as the understanding of how to use the API.
low Lai points of improving the complexity reduction of dependence:
-
improved no circular dependencies
- Stable Dependencies Principle (SDP).Decomposition can reduce the complexity of the system level, but there is still a complex degree can not be resolved, that is, the problem of dependence. This is in the agile software development: principles, patterns and practice in the dependence of the discussion is very detailed. As participants increase, the interaction becomes more complex. And the current software scale, various types of SDK API Framework, API, a variety of more and more libraries, the dependency between the modules will become more and more complex. Obviously
module in the system or component is too much, the need for further consolidation. But the real problem is that there is a two-way and circular dependence.For example, the Computing module is also responsible for the calculation of the UI module is also dependent on the module, it may be because the UI layer holds a key parameters required for the calculation. If the change in the UI layer, it may affect the Computing, there is no prediction of the behavior of the customer to the unstable impression.
so dependent on the relationship between modules must be simplified, there is absolutely not a circular dependence. Take Chromium as an example, it has a strict definition of the dependence on each module, and there are DEPS in the compiler to ensure that programmers will not make mistakes. The following figure is the definition of the Component Chromium dependency, which is defined as the dependency of the Component internal directory:
when the underlying module needs to rely on the upper module, going through the dependency inversion (DIP) to deal with. Simply by defining an interface by the bottom module, the upper module is required to realize and inject into the underlying module.
using abstraction reduces the complex degree of
the learning process is the most effective way is classified, which use is abstract thinking. In the face of changing all the time the weather, human by abstracting the shape of clouds, we can forecast the weather. There is an abstract process of modeling. The abstract is not object-oriented language. It is exclusive, and language independent, is essentially a way of thinking.The biggest difference between it and the separation is that the abstract emphasis on the details of the hidden, only concerned about the essence of the core. And then the emphasis on the details of the problem of decomposition and composition. In order to
the fastest route for fixed points. From the angle of separation, can be divided into the following questions: how much time
walk? How much time by public transportation? How much time do you take in a taxi?.
and from the abstract point of view, the solution will is such:
traversal of all possible means of transportation, take time consuming minimum:
1. Walk
2. By public transport. By taxi
正在翻譯中..