多层设计中各个分层核心关注的内容:

Domain Model Layer

The “Domain Model Layer” is the Heart of the Software. 负责业务概念、流程和领域规则

This layer should be responsible for representing business concepts, information on the status of the business processes and implementation of domain rules. It should also contain states reflecting the status of business processes, even when the technical storage details are delegated to the lower layers of the infrastructure (Repositories, etc.)

The components of this layer implement the system core functionality and encapsulate all the relevant business logic (generally called Domain logic according to DDD terminology). Basically, this layer usually contains classes which implement the domain logic within their methods, although it can also be implemented using a dynamic business rule system, etc.

Following the architecture patterns in DDD, this layer must completely ignore the data persistence details. These persistence tasks should be performed by the infrastructure layer.

The main reason for implementing the domain logic layer (business) is to differentiate and clearly separate the behavior of the domain rules (business rules that are the responsibility of the domain model) and the infrastructure implementation details (like data access and specific repositories linked to a particular technology such as O/RMs, or simply data access libraries or even cross-cutting aspects of the architecture). Thus, by isolating the application Domain, we will drastically increase the maintainability of our system and we could even replace the lower layers (data access, O/RMs, and databases) with low impact to the rest of the application.

Data Persistence Infrastructure Layer

实现数据的存储机制

The data persistence components provide access to the data hosted within the boundaries of our system (e.g., our main database which is within a specific BOUNDED CONTEXT), and also to the data exposed outside the boundaries of our system, such as Web services of external systems. Therefore, it has components like “Repositories” that provide such functionality to access the data hosted within the boundaries of our system, or “Service Agents” that will consume Web Services exposed by other external backend systems. In addition, this layer will usually have base classes/components with reusable code for all the repository classes.

Application Layer

协调应用的各种活动,但不包括业务逻辑和业务状态

The Application layer should be a Layer that coordinates the activities of the Application as such, but it is essential that it does not include any domain logic or business/domain state. However, it can contain progress states of the application tasks.

The SERVICES that typically reside within this layer (remember that the SERVICE pattern is applicable to different Architecture layers), are services that usually coordinate the SERVICES and objects of other lower level layers.

The most common case of an Application Service is a Service that coordinates all the “plumbing” of the application, that is, orchestration of calls to the Domain Services and later, calls to Repositories to perform persistence, using UoW, transactions, etc.

Another more collateral case would be a SERVICE of the APPLICATION layer responsible for receiving E-Commerce purchase orders in a specific XML format. In this scenario, the APPLICATION layer will be responsible for reformatting/rebuilding such Purchase Orders from the original XML received and converting them into Domain Model ENTITY objects. This example is a typical case of APPLICATION logic. We need to perform a format conversion, which is a requirement of the application and not something that forms part of the Domain logic, so it should not be located in the Domain layer but rather in the Application layer.

key patterns / 关键的模式

Categories

Patterns

Application layer components

 Application Façade

 Chain of Responsibility

 Command

Concurrency and transactions

 Capture Transaction Details

 Coarse-Grained Lock

 Implicit Lock

 Optimistic Offline Lock

 Pessimistic Offline Lock

 Transaction Script

Workflows

 Data-driven workflow

 Human workflow

 Sequential workflow

 State-driven workflow

The Distributed Services Layer

实现通道(通讯)的重用

The Service Layer typically exposes the following topics:

- Services: Services expose interfaces that receive incoming messages. In short, services are like a façade layer for remote clients. Services expose the application and domain logic to the potential consumers such as Presentation Layer or other remote Services/Applications.

- Message Types: In order to exchange data via the Service Layer, data structures are serialized to messages. The service layer will also expose data types and contracts that define the data types used in the messages (like DTOs or Resource Representations), although these data classes could be defined within the Application Layer instead of the Distributed Services Layer, so they can be re-used from different channels (direct .NET CLR, etc.).

In a Microsoft platform, we can currently choose between two message oriented base technologies and Web services / 可用的技术

- ASP.NET Web Services (ASMX)

- Windows Communication Foundation (WCF)

- Workflow-Services ‟WCF+WF‟‟)

- RAD (Rapid Application Development):

o WCF Data.Services (aka. ADO.NET DS)

o Implementation of OData from Microsoft.

o WCF RIA Services

Presentation Layer

这个是都比较熟悉的部分,软件的最终展示部分,主要的类型和模式有

Archetype

Technology

Architecture Pattern – Presentation layer

Rich applications (Desktop applications / Windows)

 WPF/Silverlight

 WinForms

 MVVM

 MVP

Web applications (HTML dynamic applications)

 ASP.NET MVC

 ASP.NET Forms

 MVC

 MVP

RIA applications

 Silverlight

 HTML 5 and JavaScript

 MVVM

 MVVM

Mobile applications

 Silverlight Mobile

 MVVM

OBA Applications (Office)

 .NET VSTO

 MVP

Cross-cutting Infrastructure Concerns

跨越各个层的处理,AOP就是这方面的关注点

Most applications have common functionality used by the different logical layers and even in different physical Tiers. In general, this type of functionality covers operations like authentication, authorization, cache, exception management, logging, tracking, instrumentation and validation.

All these aspects are commonly called “Cross-cutting concerns” or “Horizontal concerns” because they affect the entire application and we should be able to reuse these components from the different layers.

整个软件系统通过如上的分层,架构清晰、职责分明,对于大型项目和TDD等很合适,当然由于层次的分割对软件效率会一定的影响,但相对来说可以忽略。不过实际中我们遇到的一些短期、人数比较小的项目,RAD方式相对还是比较高效的,分层就没有这么多了。

因此具体如何选择和实现,需要根据具体的场景进行选择。

系统各层关注的内容【DDDD笔记】相关推荐

  1. 架构设计过程【DDDD笔记】

    软件的架构设计对于项目的成功有否有很重要的影响,一般的软件架构设计过程: 1.确定系统涉及的多个方面内容: Type of application to be built. (Web, RIA, Ri ...

  2. 软件架构--《系统架构:复杂系统的产品设计与开发》笔记

    <系统架构:复杂系统的产品设计与开发>笔记 1 简介 1.1 内容简介 1.2 作者介绍 2 摘要 系统架构原则 系统思维任务步骤 系统思维 1 系统架构简介 1.1 复杂系统的架构 1. ...

  3. 《Linux系统和网络性能监测》读书笔记

    2019独角兽企业重金招聘Python工程师标准>>> <Linux系统和网络性能监测>读书笔记 性能调优是找出系统瓶颈并消除这些瓶颈的过程,很多系统管理员认为性能调优仅 ...

  4. 系统级程序设计第一课内容——Linux系统与操作 2022.5.2

    系统级程序设计第一课内容--Linux系统与操作 文章目录 系统级程序设计第一课内容--Linux系统与操作 一.Linux文件系统与操作 二.文件操作 1.主要函数 2.open() 3.read( ...

  5. win怎么在计算机里按日期搜索文件,小编教你在Win10系统电脑中设置搜索内容日期范围的小技巧...

    在使用电脑的过程中,很多时候为了我们为了快速找到某个文件,都会使用到系统的搜索功能,不过大家会发现,这项搜索功能在默认情况下,只能选择固定的日期范围比如:今天.昨天.本周.上周.本月.上月.今年.去年 ...

  6. 监控系统维保的六点内容

    现今社会,监控系统的应用极为广泛,公共区域处处有监控.监控系统非常重要,能够一定程度上维护公共区域安全,所以,监控系统的维保也是必须的,今天介绍监控系统维保的六点服务内容. (监控设备) 维保内容包含 ...

  7. 【vim】系统剪切板、vim寄存器之间的复制粘贴操作命令?系统剪切板中的内容复制粘贴到命令行?vim文本中复制粘贴到命令行

    一.系统剪切板和文本内容的复制粘贴 1.1 从系统剪切板复制粘贴到文本中 需要操作3次: 分别是英文双引号.一个加号或梅花号,最后是一个p 也即"+p 或者直接使用组合键[Shift + i ...

  8. 华为在偷偷更新鸿蒙,华为手机系统只更新了一点内容,更新包却狂大:华为在偷偷摸摸做什么?...

    原标题:华为手机系统只更新了一点内容,更新包却狂大:华为在偷偷摸摸做什么? 作者:IT老菜鸟 我一直怀疑华为在偷偷摸摸的更换安卓底层虚拟机的东西,但是我就是抓不到证据.相信很多时候很多网友也有这样的感 ...

  9. Css实现省略号...及悬浮层显示全部内容的方法:

    1.单行文本省略: overflow: hidden;//溢出隐藏 white-space: nowrap;//禁止换行 text-overflow: ellipsis;//... 2.多行文本省略: ...

  10. 家族关系查询系统程序设计算法思路_【学习笔记】数据库基础 - 查询优化

    目录 什么是数据库查询优化? 影响查询优化的因素 优化策略概述 查询优化的总体思路 语义优化 -- 内容等价性 语法优化(逻辑层优化)---语法等价性 执行优化(物理层优化) 查询优化在DBMS中的位 ...

最新文章

  1. SpringBoot(十二)_springboot整合PageHelper
  2. Linux安装PHP报错Sorry, I cannot run apxs. Possible reasons follow:
  3. ORACLE1.10 - 一对多
  4. 变长参数模板 和 外部模板
  5. 长度最小的子数组--滑动窗口
  6. python学习-38迭代器和生成器
  7. Symantec(赛门铁克)非受管检测
  8. shell之case和function
  9. android preferenceActivity的用法
  10. Apache安装及jboss部署说明文档1
  11. 因代码不规范,码农枪击4名同事,一人情况危急
  12. 从Model1,Medel2到显示层框架的出现
  13. 压力焊2021年焊工作业考试题库
  14. 机器学习训练数据集图片标注工具推荐
  15. java连接ftp服务器
  16. 怎么避免后台被搜索_【干货】一文读懂360搜索oCPC
  17. linux基础教程之在Linux上安装Go语言开发包
  18. python未来怎么样至少现在很开心_Python的未来解析
  19. GitHub的使用(上)
  20. BUU Crypto[1-8]

热门文章

  1. android系统各种版本所占市场比例
  2. 【无标题】梦笔记2022-02-20
  3. 如何让应用出现在LINUX的右键/打开方式/更多应用
  4. 糙哥、糙姐:指为了解决问题,随意调整参数的程序员
  5. VirtualBox虚拟机的samba也有问题
  6. 一篇介绍OpenJDK字体的文章
  7. 超过千字的文章,才统计勤写标兵
  8. 研发做好了,产品不一定能卖掉;研发做不好,没东西可卖
  9. docker 中文目录及文件乱码_解决docker容器中文乱码,修改docker容器编码格式
  10. 二叉树的建立 java_Java中二叉树的建立和各种遍历实例代码