这是最常使用的技术了。将一个大问题,不断的拆解为各个小问题进行分析研究,然后再组合到一起。在西方称为Divide and Conquer P的英文翻譯

这是最常使用的技术了。将一个大问题,不断的拆解为各个小问题进行分析研究

这是最常使用的技术了。将一个大问题,不断的拆解为各个小问题进行分析研究,然后再组合到一起。在西方称为Divide and Conquer Principle (分而治之原则)。

在结构化编程的时代,提倡模块化(Modularization)。最早提出软件复杂度的工程师提出了基于组件的软件(Component Based Software)。不知道是不是从乐高积木上得到的启发,将系统中拆分为不同的组件,各自实现,然后再组装在一起。

在架构设计中,无论是C/S风格,分层,还是N-Tier,SOA,和前面组件式一样,都是在进行分解,它们都更加强调组合交互。设计上,分分职责,定义好接口,就可以各自开发了。然后将交互限定于接口层,就能够很好的控制整个系统的复杂度。

比如应用层使用一个语音库(Speech Library,一个以库的形式的模块化应用), 根本不用关心其内部实现,只要了解如何使用它的API就可以了。

改善低赖降低复杂度
改进依赖关系的要点:
- 无环形依赖
- 稳定依赖原则(SDP)

分解可以降低系统层级的复杂度,但还有一种复杂度无法解决,即依赖的问题。这在敏捷软件开发:原则、模式与实践中关于依赖性的讨论很详细。当参与者增加时,交互就会随之变得复杂。而当前的软件规模,系统中的各类SDK的API, Framework的API, 各种第三方库越来越多,模块间的依赖就会越来越复杂。

显然系统中的模块或者组件太多了,需要进一步整理。但真正的问题在于出现了双向和环形的依赖。比如上图中负责计算的Computing模块也依赖到了UI模块,或许是因为UI层持有一个计算所需的关键参数。如果UI层变更,就可能会影响到Computing,出现无法预测的行为,给客户以不稳定的印象。

所以模块间的依赖关系必须简化,绝对不能出现环形的依赖。以Chromium为例,它对各个模块的依赖就有严格的定义,并且有DEPS在编译期保证程序员不会犯错。下图是Chromium Component依赖关系的定义,其中Component内部目录的依赖关系也有定义:


当底层模块需要依赖上层模块的实现时,就要通过依赖倒置(DIP)来处理。简单而言就是由底层模块定义一个接口,要求上层模块实现并注入到底层模块。


使用抽象降低复杂度
人的学习过程最有效的一种方式就是归类,其中运用的就是抽象思维。面对变幻无常的天气,人类通过对云的形状进行抽象,就可以预测天气变化。这里有一个抽象建模的过程。

抽象并不是面向对象语言专属,其实它和语言无关,本质上是一个思考的方式。它和分离的最大区别在于,抽象强调将细节隐藏,只关注核心的本质。而后者则重视于细节问题的分解和组合。

以求固定两点的最快捷路线为例。从分离的角度来,可以分解为以下问题:

步行需要多少时间?
乘公共交通多少时间?
乘的士多少时间?
组合以上答案,再评估哪一个最快捷的方式。
而从抽象的角度来看,解决的思路会是这样的:

遍历所有可能的交通工具,取耗时最小的:
1. 步行
2. 乘公共交通
3. 乘的士

先给出一个抽象的解决思路,至于细节,则是进一步的实现。抽象最大的威力在于它比实现要稳定,也最能用于固化核心设计。在开发过程中,常常围绕着各种细节讨论,似乎抽象过于虚。但是如果没有以抽象来建立系统的设计全景,有些讨论将变得效率低下。

在敏捷软件开发:原则、模式与实践中,Martin大叔简单的用抽象类在总类个数中的占比作为抽象性的度量,再结合稳定性的度量,用来评估设计。详情可以参考组件设计原则之概念篇(三)。

以通俗原则降低复杂度
设计和实现时引入不必要的抽象或分解,也是一种复杂度.考虑扩展性也是确定会发生的需求才要考虑进来,否则就是引入不必要的复杂性.这也是敏捷设计所倡导的.
一些约定俗成的命名,常常隐含着设计.比如Observer, Client, Adapter等等.我们要学习这些模式,也要准确加以命名.否则很容易造成理解上的问题.

小结
软件设计是一个平衡的过程,软件的复杂度决定着系统的可维护性、可扩展性和灵活性。我们再来回顾一下前人定义出软件设计的三原则:模块化、抽象和信息隐藏。McCabe也曾有论文专门讨论将圈复杂度应用度量设计的复杂度,不过已经历史久远。现在来看以依赖关系来评估设计的复杂度会更为有效。有兴趣可以了解一下CppDepend。另外Google的工程师则基于LLVM IR也实现了一个工具用于依赖关系分析(Generateing Precise Dependencies for Large Software)。
0/5000
原始語言: -
目標語言: -
結果 (英文) 1: [復制]
復制成功!
This is the most commonly used technology. One big problem, continued dismantling for various small issues are analyzed and then grouped together. In the West, known as Divide and Conquer Principle (principle of divide and rule).In an era of structured programming, promotion of modular (Modularization). First software engineer complexity of component-based software (Component Based Software). Do not know is not got inspired from the LEGO will be split into different components in the system, their implementation, and then assembled together.In the schema design, whether it's C/S style, layering, and N-Tier,SOA, and front component, are broken down, they have more emphasis on combination interaction. Design, function, and interface is defined, it can be developed. Interaction is then limited to the interface layer, you can better control the complexity of the system as a whole.For example using a voice application layer library (Speech Library, a library in the form of modular applications), just don't care about their internal implementation, as long as the API you can learn how to use it.Improved thanks to reduced complexityImproved dependency: -Without relying on the ring -The stable dependencies principle (SDP)Decomposition reduces the level of complexity of the system, but there is also a complexity cannot be resolved, namely, dependency problems. Agile software development: principles, patterns, and practices about dependency discussed in great detail. As the participants increased interaction will become complicated. And the current scale of software, API SDK on your system, the API Framework, various third party libraries more dependency between modules will be more and more complicated.Apparently too many modules or components in the system, need further sorting. But the real problem is bi-directional and circular dependencies. Pictured above is responsible for calculating Computing modules to the UI module, perhaps because the UI layer holds a key parameter required. If the UI changes, it may affect the Computing, unpredictable behavior occurs, and give customers the impression of instability.So the dependencies between modules must be simplified, no circular dependency occurs. A case study of Chromium and its dependence on each module has a strict definition, and DEPS at compile-time to ensure programmers make mistakes. Below is the definition of Chromium Component dependencies and dependencies of the Component within the directory has also defined:When APIs rely on the upper module implementation, through dependency inversion (DIP) to deal with. In simple terms is the underlying module defines an interface that requires upper module and into the underlying modules.Using abstraction to reduce complexityHuman learning process is the most effective way is to classify, the use of which is abstract. Face the vagaries of the weather, human beings through the abstract shapes of clouds, it is possible to predict weather changes. Here's an abstract modeling of process.Abstract object-oriented language is not exclusive, in fact, it and language-independent, is essentially a way of thinking. The biggest difference between it and separated, abstract emphasis on the details hidden, focusing only on core essence. While the latter decomposition and combination of attention to detail.To fixed points of the most efficient routes for example. From the perspective of separation, can be broken down into the following questions:Walking time required?How long does it take public transportation?Taxi in how much time?Combinations above answer, then assess which one is the most efficient way.From an abstract point of view, the solution would be:Loop through all possible means of transport, and takes a minimum of: 1. the walk 2. take public transportation 3. by taxiGiven an abstract idea, details, further implementation. Higher power lies in its abstraction to achieve stability, and most can be used for curing core design. In the process of development, often around the details of the discussion seems to abstract too virtual. But if there is no abstraction to build system design-panoramic, some of the discussion will become inefficient.Agile software development: principles, patterns, and practice, uncle Martin in a simple abstract class in the total number of ratio as a measure of abstraction, combined with the stability of the measure used to evaluate a design. Details can refer to the concept paper on principles of component design (c).Based on common principles to reduce complexityDesign and implementation unnecessarily abstractions or decomposition, is also a kind of complexity. Considering scalability needs to consider that can occur is also determined, otherwise introduce unnecessary complexity. It is also advocated by Agile Design.Some common names often implies the design. For example, Observer, Client, Adapter, and so on. We have to learn these patterns, also to be accurately named. Otherwise it is easy to understand the problem.SummarySoftware design is a balancing process, software complexity of the system maintainability, scalability, and flexibility. We look the previous define software design of three principles: modularity, abstraction, and information hiding. McCabe also had papers devoted to the application of cyclomatic complexity measure the complexity of the design, but has a long history. Now come to rely on to assess the relationship between the complexity of the design will be more effective. Have interest to know the CppDepend. Other Google engineers are based on LLVM IR implemented a tool for dependency analysis (Generateing Precise Dependencies for Large Software).
正在翻譯中..
結果 (英文) 3:[復制]
復制成功!
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

First give an abstract solution, as for the details, it is further realized. The power of abstraction is that it is more stable than it is, and it is also the most used in the design of the core. In the development process, often around the various details of the discussion, it seems that the abstract is too empty. But if there is no abstraction to build the system's design panorama, some discussions will become inefficient.

in Agile Software Development: principles, patterns and practice, Uncle Martin simple with abstract classes in the total number of accounts for than as an abstract metric, combined with the stability of the metric used to evaluate the design.Details can refer to the concept of component design principles (three).

popular principles to reduce complexity
design and implementation introduced unnecessary abstraction and decomposition, but also a complexity. Considering scalability is to determine the demand will happen only to be considered in, otherwise is to introduce unnecessary complexity. This is also agile design advocated by.
some conventional naming. Often implies design. Such as the observer, the client adapter and so on. We want to learn these patterns, to properly named. Otherwise it is very easy to cause the understanding on the issue. Summary
software design is a balance of the process,The complexity of the software determines the maintainability, scalability and flexibility of the system. We come back to the three principles that define the design of the software. McCabe also has a special discussion on the complexity of the application of the loop complexity, but it has a long history. Now it's more effective to evaluate the complexity of the design by using a dependency relationship. Interested can learn about CppDepend. LLVM Google Generateing IR Software for Large is a tool for Precise Dependencies.
正在翻譯中..
 
其它語言
本翻譯工具支援: 世界語, 中文, 丹麥文, 亞塞拜然文, 亞美尼亞文, 伊博文, 俄文, 保加利亞文, 信德文, 偵測語言, 優魯巴文, 克林貢語, 克羅埃西亞文, 冰島文, 加泰羅尼亞文, 加里西亞文, 匈牙利文, 南非柯薩文, 南非祖魯文, 卡納達文, 印尼巽他文, 印尼文, 印度古哈拉地文, 印度文, 吉爾吉斯文, 哈薩克文, 喬治亞文, 土庫曼文, 土耳其文, 塔吉克文, 塞爾維亞文, 夏威夷文, 奇切瓦文, 威爾斯文, 孟加拉文, 宿霧文, 寮文, 尼泊爾文, 巴斯克文, 布爾文, 希伯來文, 希臘文, 帕施圖文, 庫德文, 弗利然文, 德文, 意第緒文, 愛沙尼亞文, 愛爾蘭文, 拉丁文, 拉脫維亞文, 挪威文, 捷克文, 斯洛伐克文, 斯洛維尼亞文, 斯瓦希里文, 旁遮普文, 日文, 歐利亞文 (奧里雅文), 毛利文, 法文, 波士尼亞文, 波斯文, 波蘭文, 泰文, 泰盧固文, 泰米爾文, 海地克里奧文, 烏克蘭文, 烏爾都文, 烏茲別克文, 爪哇文, 瑞典文, 瑟索托文, 白俄羅斯文, 盧安達文, 盧森堡文, 科西嘉文, 立陶宛文, 索馬里文, 紹納文, 維吾爾文, 緬甸文, 繁體中文, 羅馬尼亞文, 義大利文, 芬蘭文, 苗文, 英文, 荷蘭文, 菲律賓文, 葡萄牙文, 蒙古文, 薩摩亞文, 蘇格蘭的蓋爾文, 西班牙文, 豪沙文, 越南文, 錫蘭文, 阿姆哈拉文, 阿拉伯文, 阿爾巴尼亞文, 韃靼文, 韓文, 馬來文, 馬其頓文, 馬拉加斯文, 馬拉地文, 馬拉雅拉姆文, 馬耳他文, 高棉文, 等語言的翻譯.

Copyright ©2024 I Love Translation. All reserved.

E-mail: