"层"和"层"之间有什么区别?

时间:2020-03-06 14:35:35  来源:igfitidea点击:

"层"和"层"之间有什么区别?

解决方案

阅读有关该问题的Scott Hanselman的文章:http://www.hanselman.com/blog/AReminderOnThreeMultiTierLayerArchitectureDesignBroughtToYouByMyLateNightFrustrations.aspx

Remember though, that in "Scott World" (which is hopefully your world also :) ) a "Tier" is a unit of deployment, while a "Layer" is a logical separation of responsibility within code.  You may say you have a "3-tier" system, but be running it on one laptop.  You may say your have a "3-layer" system, but have only ASP.NET pages that talk to a database.  There's power in precision, friends.

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

我找到了一个定义,该定义表示层是逻辑上的隔离,层是物理上的隔离。

Logical layers are merely a way of
  organizing your code. Typical layers
  include Presentation, Business and
  Data – the same as the traditional
  3-tier model. But when we’re talking
  about layers, we’re only talking about
  logical organization of code. In no
  way is it implied that these layers
  might run on different computers or in
  different processes on a single
  computer or even in a single process
  on a single computer. All we are doing
  is discussing a way of organizing a
  code into a set of layers defined by
  specific function.
  
  Physical tiers however, are only about
  where the code runs. Specifically,
  tiers are places where layers are
  deployed and where layers run. In
  other words, tiers are the physical
  deployment of layers.

资料来源:罗克福德·洛特卡(Rockford Lhotka),所有应用程序都应该是n层吗?