当前位置:网站首页>领域驱动下cloud项目中单个服务的示例
领域驱动下cloud项目中单个服务的示例
2022-06-30 07:56:00 【匿称s】
Domain Driven Design - 领域驱动设计【重点在于设计】
每个人和每个项目对于DDD的理解和实施都是有不同的看法,这里所指出的架构方案也只是其中的一种方式而已。
核心的想法就是让代码高内聚,低耦合,让项目的重点放在领域逻辑,而并不是在表现输出上。
这里的四层架构也是DDD所倡导的,核心理念这里就不多说了...外面说理念的文章太多了..这里就给大家看下在我搭建的微服务架构下DDD的践行方式


Demo-application 定义软件要完成的任务,这一层很轻,没有业务的标识,只是为领域层起到协调任务【服务】的作用
|- com.ddd.demo
|- service 定义项目中可提供的服务
XXXservice
|- aop 定义切面要处理的业务:处理日志记录等
Demo-domain 领域层,这一层是业务的核心,虽然细节都是由基础设施层完成,但是这一层数聚合基础设施完成业务的表达层
|- com.ddd.demo
|- XXX 包为application中定义的服务名称,具体实现类在此包下实现
|- impl 具体服务的实习类,实现 XXXservice的接口
|- repo 定义需要从基础设施层的仓库接口
|- vo 定义服务内的服务实现类的返回值,也是基础设施层仓库实现类返回数据标准
Demo-infrastructure 基础设施层,像其他层提供表达能力,内部与数据进行交互,包括不仅限于数据库。
|- entity 实体类,作为数据查询的映射
|- mapper 数据存储对象,相当于dao层
|- repo 具体仓库的实现类,实现domain中的repo接口
|- utils 工具包
|- config 配置类
Demo-interfaces 表示层,用于接收系统外部的请求和其他服务的调用
|- dto 数据传输对象,可在此做数据校验
|- facade 表示层,这里用于做接收请求也就是控制器
|- feign 跨服务的接口调用定义的api边栏推荐
- Deep learning - residual networks resnets
- Projection point of point on line
- 342 maps covering exquisite knowledge, one of which is classic and pasted on the wall
- Miracle Mu server rental selection is real and easy to use, stable and intrusion proof
- Deep learning -- sequence model and mathematical symbols
- Investment and financing analysis report of Supply Chain & logistics industry in 2021
- Common sorting methods
- Deep learning - embedding matrix and learning word embedding andword2vec
- Xiashuo think tank: 50 planet updates reported today (including the global architects Summit Series)
- Analysis of cross clock transmission in tinyriscv
猜你喜欢

At the end of June, you can start to make preparations, otherwise you won't have a share in such a profitable industry

CRM&PM如何帮助企业创造最优销售绩效
![January 23, 2022 [reading notes] - bioinformatics and functional genomics (Chapter 6: multiple sequence alignment)](/img/48/cfe6ab95b4d4660e3ac3d84ae5303b.jpg)
January 23, 2022 [reading notes] - bioinformatics and functional genomics (Chapter 6: multiple sequence alignment)

深度学习——序列模型and数学符号

342 maps covering exquisite knowledge, one of which is classic and pasted on the wall

Research Report on search business value in the era of big search in 2022

6月底了,可以开始做准备了,不然这么赚钱的行业就没你的份了

Palindrome substring, palindrome subsequence

mysql无法连接内网的数据库

2022 Research Report on China's intelligent fiscal and tax Market: accurate positioning, integration and diversity
随机推荐
Examen final - notes d'apprentissage PHP 3 - Déclaration de contrôle du processus PHP
Final review -php learning notes 7-php and web page interaction
November 21, 2021 [reading notes] - bioinformatics and functional genomics (Chapter 5 advanced database search)
6月底了,可以开始做准备了,不然这么赚钱的行业就没你的份了
Armv8 (coretex-a53) debugging based on openocd and ft2232h
July 30, 2021 [wgs/gwas] - whole genome analysis process (Part I)
Cross compile opencv3.4 download cross compile tool chain and compile (3)
2021.11.20 [reading notes] | differential variable splicing events and DTU analysis
String and underlying character types of go data type
Introduction notes to pytorch deep learning (XII) neural network - nonlinear activation
Hit the industry directly | the flying propeller launched the industry's first model selection tool
JS code case
JS代码案例
深度学习——嵌入矩阵and学习词嵌入andWord2Vec
Deep learning - residual networks resnets
期末复习-PHP学习笔记3-PHP流程控制语句
Deep learning -- using word embedding and word embedding features
Tue Jun 28 2022 15:30:29 GMT+0800 (中国标准时间) 日期格式化
25岁,从天坑行业提桶跑路,在经历千辛万苦转行程序员,属于我的春天终于来了
Pre ++ and post ++ overloads