“Layers”和“Tiers”的区别是什么?


当前回答

我使用层来描述我的解决方案组件中的架构师或技术堆栈。通常在涉及网络或进程间通信时,我使用层对这些组件进行逻辑分组。

其他回答

阅读Scott Hanselman关于这个问题的帖子:关于“三/多层/层架构/设计”的提醒:

请记住,在“Scott的世界”(希望也是你的世界:)中,“Tier”是一个部署单元,而“Layer”是代码中责任的逻辑分离。你可能会说你有一个“三层”系统,但在一台笔记本电脑上运行它。你可能会说你有一个“三层”系统,但只有ASP。与数据库对话的NET页。精准就是力量,朋友们。

我使用层来描述我的解决方案组件中的架构师或技术堆栈。通常在涉及网络或进程间通信时,我使用层对这些组件进行逻辑分组。

IBM的三层体系结构文章有一个章节专门讨论这个主题:

In discussions of three-tier architecture, layer is often used interchangeably – and mistakenly – for tier, as in 'presentation layer' or 'business logic layer.' They aren't the same. A 'layer' refers to a functional division of the software, but a 'tier' refers to a functional division of the software that runs on infrastructure separate from the other divisions. The Contacts app on your phone, for example, is a three-layer application, but a single-tier application, because all three layers run on your phone. The difference is important, because layers can't offer the same benefits as tiers.

Yes my dear friends said correctly. Layer is a logical partition of application whereas tier is physical partition of system tier partition is depends on layer partition. Just like an application execute on single machine but it follows 3 layered architecture, so we can say that layer architecture could be exist in a tier architecture. In simple term 3 layer architecture can implement in single machine then we can say that its is 1 tier architecture. If we implement each layer on separate machine then its called 3 tier architecture. A layer may also able to run several tier. In layer architecture related component to communicate to each other easily. Just like we follow given below architecture

表示层 业务逻辑层 数据访问层

客户端可以与“表示层”进行交互,但出于安全考虑,客户端可以访问“业务逻辑层”下一层的公共组件(如业务逻辑层的公共组件)。 问:为什么我们使用层结构? 因为如果我们实现了层结构,我们就能提高应用程序的效率

= = >安全

= = >可管理性

= = >可伸缩性

其他需求,如开发应用程序后,我们需要改变DBMS或修改业务逻辑等,那么这是必要的。

问:为什么我们要使用分层架构?

因为每一层的物理实现都提供了更好的效率,没有层架构我们就无法实现层架构。分离机实现分离 层和分离层是实现一个或多个层这就是我们使用它的原因。 它用于容错目的。 ==>易于维护。

简单的例子

就像银行开在一个房间里,员工在里面分类:

门房 现金的人 负责介绍银行方案的人 经理

它们都是系统的相关组件。

如果我们去银行贷款,首先是一个门卫微笑着开门 之后我们就去就近介绍所有贷款方案的人 我们去经理小屋,通过贷款。 在那之后,最后我们去收银台贷款。 这些是银行的层结构。

层级呢? 一家银行的分行开在一个城镇,接着又开在另一个城镇,接着又开在另一个城镇 但是每个分支的基本要求是什么呢

门房 现金的人 负责介绍银行方案的人 经理

层和层的概念完全一样。

我喜欢下面来自微软应用程序架构指南2的描述

层描述了应用程序中功能和组件的逻辑分组;而层描述了功能和组件在独立服务器、计算机、网络或远程位置上的物理分布。尽管层和层使用相同的名称集(表示、业务、服务和数据),但请记住,只有层意味着物理分离。