有人能解释一下软件设计和软件架构的区别吗?

更具体地说;如果你让别人给你展示“设计”——你希望他们展示什么?“建筑”也是如此。

我目前的理解是:

设计:系统特定模块/部分的UML图/流程图/简单线框(用于UI) 架构:组件图(显示系统的不同模块如何相互通信以及如何与其他系统通信),要使用什么语言,模式……?

如果我说错了,请指正。我提到了维基百科在http://en.wikipedia.org/wiki/Software_design和http://en.wikipedia.org/wiki/Software_architecture上有文章,但我不确定我是否理解正确。


当前回答

架构: 结构设计是在更高的抽象层次上进行的工作,它将技术上重要的需求实现到系统中。该体系结构为进一步的设计奠定了基础。

设计: 通过在每个抽象层的迭代过程来填充架构所没有的内容的艺术。

其他回答

程序或计算系统的软件体系结构是系统的结构,由软件组件、这些组件的外部可见属性以及它们之间的关系组成。

(来自维基百科,http://en.wikipedia.org/wiki/Software_architecture)

软件设计是解决问题和规划软件解决方案的过程。在软件的目的和规格确定之后,软件开发人员将设计或雇用设计人员为解决方案制定计划。它包括低级组件和算法实现问题以及体系结构视图。

(来自维基百科,http://en.wikipedia.org/wiki/Software_design)

我自己也说不出更好的话了:)

我认为当我们讨论设计与架构时,我们应该使用下面的规则来确定:如果您创建的软件图的元素可以一一映射到编程语言的语法结构,那么就是设计,如果不是架构。

So, for example, if you are seeing a class diagram or a sequence diagram, you are able to map a class and their relationships to an Object Oriented Programming language using the Class syntactical construction. This is clearly Design. In addition, this might bring to the table that this discussion has a relation with the programming language you will use to implement a software system. If you use Java, the previous example applies, as Java is an Object Oriented Programming Language. If you come up with a diagram that shows packages and its dependencies, that is Design too. You can map the element (a package in this case) to a Java syntactical construction.

Now, suppose your Java application is divided in modules, and each module is a set of packages (represented as a jar file deployment unit), and you are presented with a diagram containing modules and its dependencies, then, that is Architecture. There isn’t a way in Java (at least not until Java 7) to map a module (a set of packages) to a syntactical construction. You might also notice that this diagram represents a step higher in the level of abstraction of your software model. Any diagram above (coarse grained than) a package diagram, represents an Architectural view when developing in the Java programming language. On the other hand, if you are developing in Modula-2, then, a module diagram represents a Design.

(摘自http://www.copypasteisforword.com/notes/software-architecture-vs-software-design)

用我自己的话来说,你是对的;

体系结构是将系统需求分配给系统元素。关于架构的四个陈述:

它可以引入非功能性需求,如语言或模式。 它定义了组件、接口、时序等之间的交互。 它不应该引入新的功能, 它将系统要执行的(设计的)功能分配给元素。

当对系统的复杂性进行细分时,体系结构是必不可少的工程步骤。

例如:想想你的房子,你的厨房不需要建筑师(只涉及一个元素),但整个建筑需要一些交互定义,比如门和屋顶。

设计是对功能(提议的)实现的一种信息表示。它旨在获得反馈,并与利益相关者进行讨论。这可能是一个很好的实践,但不是一个必要的工程步骤。

在厨房安装之前,最好能看到厨房的设计,但对于烹饪要求来说不是必需的:

如果我想一下,你可以这样说:

架构是为公众/工程师在更详细的抽象层次上设计的 设计是在一个不太详细的抽象层次上面向公众的

我喜欢Roy Thomas Fielding在他的论文中对什么是软件架构的定义和解释: 架构风格与基于网络的软件架构设计

软件体系结构是软件系统在其操作的某个阶段的运行时元素的抽象。一个系统可能由许多抽象层次和许多操作阶段组成,每一个都有自己的软件体系结构。

他强调“运行时元素”和“抽象层次”。

架构是“难以改变的设计决策”。

在使用TDD之后,这实际上意味着你的设计一直在变化,我经常发现自己在这个问题上挣扎。上面的定义摘自Martin Fowler的《企业应用程序体系结构模式》

这意味着架构依赖于你的系统的语言、框架和领域。如果你能在5分钟内从Java类中提取出一个接口,这就不再是架构决策了。