3层架构对2层体系结构 [英] 3 Tier Architecture vs 2 Tier Architecture

查看:122
本文介绍了3层架构对2层体系结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是我们真正需要的3层架构的例子吗?可其中大部分使用的是3层架构的应用程序使用2层架构做些什么呢?

What are the examples where we really need 3 Tier Architecture ? Can Most of the Application which are using 3 Tier Architecture be done using 2 Tier Architecture ?

注意:我想看看3层架构的价值,我觉得大部分的应用程序,有3层,现在可以在2层做,所以我要寻找例子,我们绝对需要3层,没有例外情况的需要。

Note: I am trying to see value of 3 Tier Architecture, I feel most of the application that there are 3 tier right now can be done in 2 tier and so I am looking for examples where we absolutely need 3 tier and there is no exception to that need.

推荐答案

我猜你的意思是分层(分离的逻辑单元),而不是分层(分离/部署的物理单位)。分层系统的一个例子是一个Web服务器(1层)提供的网页(另一层),它借鉴了​​数据从数据库中的第3层)。

I'm guessing that you mean layered (logical units of separation) rather than tiered (physical units of separation/deployment). An example of a tiered system would be a web server (1 tier) delivering web pages (another tier) which draws on data from a database the 3rd tier).

分层架构的通常目的是分离出的责任。这有两个主要优点(其中包括)。

The usual aim of a layered architecture is to separate out responsibilities. This has two key benefits (amongst others).

您所有的设计首先会更清楚的责任不会被搅浑,因此,code会更容易阅读,理解和维护。

First of all your design will be clearer as responsibilities won't be muddied and thus the code will be easier to read, understand and maintain.

其次,机会是你会减少重复 - 例如,在一个web应用程序,如果你的网页也处理业务逻辑(或恐怖数据访问恐怖)以及显示的页面,那么你可以相当肯定多网页将试图做同样的或者类似的东西。

Secondly the chances are you'll be reducing duplication - for example in a web app if your pages are also handling business logic (or horror of horrors data access) as well as displaying the pages then you can be fairly sure that multiple pages will be trying to do the same or similar things.

您不要需要以建筑师(如成层,虽然也有其他方式)的任何一款软件,但是从琐碎的事情东西拆开结果将是一个不可维护的混乱,如果你不吨。

You don't need to architect (e.g. into layers, although there are other ways) any piece of software but for anything apart from trivial things the result will be an unmaintainable mess if you don't.

这篇关于3层架构对2层体系结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆