4层结构

User Interface (or Presentation Layer)

用户界面(或者表现层)


Responsible for showing information to the user and interpreting the user's commands. The external actor might sometimes be another computer system rather than a human user.

负责向用户显示信息以及解释用户的命令。外部的用户有时可能是另外一个计算机系统而不是真正的人。

Application Layer

应用层


Defines the jobs the software is supposed to do and directs the expressive domain objects to work out problems. The tasks this layer is responsible for are meaningful to the business or necessary for interaction with the application layers of other systems.

定义软件被设定的工作,以及指导功能强大的domain层对象来把工作搞定。这层负责的任务对业务来说很有意义的,同时也必然对与其他系统的应用层交互很有意义。

This layer is kept thin. It does not contain business rules or knowledge, but only coordinates tasks and delegates work to collaborations of domain objects in the next layer down. It does not have state reflecting the business situation, but it can have state that reflects the progress of a task for the user or the program.

这层被保持得很薄。它不包含业务逻辑或者业务相关的知识,而只是协调任务以及把任务委托给下一层中的一组对象。它不包含能反映业务的状态,但是它能够为用户或者程序有反映任务完成的进度。

Domain Layer (or Model Layer)

领域层(或者模型层)


Responsible for representing concepts of the business, information about the business situation, and business rules. State that reflects the business situation is controlled and used here, even though the technical details of storing it are delegated to the infrastructure. This layer is the heart of business software.

负责代表业务的概念,业务状态的信息以及业务规则。反映业务的状态在这儿被控制和使用,虽然如何把他它存储的技术细节是委托给基础设施层。这层是业务软件的核心。

Infrastructure Layer

基础设施层


Provides generic technical capabilities that support the higher layers: message sending for the application, persistence for the domain, drawing widgets for the UI, and so on. The infrastructure layer may also support the pattern of interactions between the four layers through an architectural framework.

提供通用的技术功能以支援其上的层次:应用层的消息发送,领域层的持久化,表现层的控件绘出,等等。基础设施层可能还通过架构型框架支持四层之间的互操作。

-- from domain driven design

你可能感兴趣的:(4层结构)