且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

什么是设计模式和架构模式之间的区别?

更新时间:2021-08-04 21:23:32

它需要一个详细的解释,但我会尽量勾画的差异来我所知。

It requires a detailed explanation but I will try to sketch the differences to best of my knowledge.

您在程序中找到它的模式蒸馏共性。它使我们能够解构一个大型复杂结构并建立使用简单的部分。它提供了一类问题的通用解决方案。

Patterns are distilled commonality that you find in programs. It allows us to deconstruct a large complex structure and build using simple parts. It provides a general solution for a class of problems.

一个大型复杂的软件经过不同层次的一系列解构。在大级别,架构模式都是工具。在较小的水平,设计模式的工具,并在执​​行层面,编程范式是的工具。

A large complex software goes through a series of deconstruction at different levels. At large level, architectural patterns are the tools. At smaller level, design patterns are the tools and at implementation level, programming paradigms are the tools.

一个模式可以在非常不同的层次发生。请参见分形。快速排序,合并排序是组织的一组元素的顺序排列的所有算法模式。

A pattern can occur at very different levels. See Fractals. Quick sort, Merge sort are all algorithmic patterns for organizing a group of elements in a order.

有关最简单的观点:

 Programming paradigms   Specific to programming language
 ......................
 Design patterns         Solves reoccurring problems in software construction
 ......................
 Architectural patterns  Fundamental structural organization for software systems
 ......................

成语是在低级别的细节填写范例特异性和语言的编程技术。

Idioms are paradigm-specific and language-specific programming techniques that fill in low-level details.

设计模式通常与code水平的共性有关。它提供了提炼和构建较小的子系统各种计划。它通常是由程序设计语言的影响。有些模式是小巫见大巫由于语言范例
设计模式是中等规模的战术,充实一些实体及其关系的结构和行为。

Design patterns are usually associated with code level commonalities. It provides various schemes for refining and building smaller subsystems. It is usually influenced by programming language. Some patterns pale into insignificance due to language paradigms. Design patterns are medium-scale tactics that flesh out some of the structure and behavior of entities and their relationships.

架构模式被视为比设计模式更高级别的通用性。
建筑模式是高层次的战略,涉及大型部件,系统的整体性质和机制。

While architectural patterns are seen as commonality at higher level than design patterns. Architectural patterns are high-level strategies that concerns large-scale components, the global properties and mechanisms of a system.

如何获得的图案?
通过:

How are patterns obtained? Through :


  1. 再利用,

  2. 分类

  3. 终于抽象提炼共性。

如果你已经按照上面的思路奠定。你会看到,辛格尔顿是一个设计模式,而MVC是建筑的模式来处理分离关注点之一。

If you have followed the thoughts laid above. You will see that Singleton is a "design pattern" while MVC is one of the "architectural" pattern to deal with separation of concerns.

尝试阅读:


  1. http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science)

  2. http://en.wikipedia.org/wiki/Design_pattern

  3. http://en.wikipedia.org/wiki/Anti-pattern

  1. http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science)
  2. http://en.wikipedia.org/wiki/Design_pattern
  3. http://en.wikipedia.org/wiki/Anti-pattern