当前位置:网站首页>领域驱动下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边栏推荐
- Xiashuo think tank: 42 reports on planet update today (including 23 planning cases)
- Global digital industry strategy and policy observation in 2021 (China Academy of ICT)
- 你了解IP协议吗?
- Analysis of cross clock transmission in tinyriscv
- Xiashuo think tank: 50 planet updates reported today (including the global architects Summit Series)
- AcrelEMS能效管理平台为高层小区用电安全保驾护航
- 【笔记】Polygon mesh processing 学习笔记(10)
- 2021-10-29 [microbiology] qiime2 sample pretreatment form automation script
- 为什么大学毕业了还不知道干什么?
- More, faster, better and cheaper. Here comes the fastdeploy beta of the low threshold AI deployment tool!
猜你喜欢

深度学习——嵌入矩阵and学习词嵌入andWord2Vec
![November 22, 2021 [reading notes] - bioinformatics and functional genomics (Section 5 of Chapter 5 uses a comparison tool similar to blast to quickly search genomic DNA)](/img/de/7ffcc8d6911c499a9798ac9215c63f.jpg)
November 22, 2021 [reading notes] - bioinformatics and functional genomics (Section 5 of Chapter 5 uses a comparison tool similar to blast to quickly search genomic DNA)

Simple application of generating function

Combinatorial mathematics Chapter 1 Notes

Deep learning -- Realization of convolution by sliding window
![December 4, 2021 [metagenome] - sorting out the progress of metagenome process construction](/img/03/eb6e6092922cf42c2c9866e7bb504d.jpg)
December 4, 2021 [metagenome] - sorting out the progress of metagenome process construction

2021 China Enterprise Cloud index insight Report

Examen final - notes d'apprentissage PHP 3 - Déclaration de contrôle du processus PHP

深度学习——词汇表征
![November 22, 2021 [reading notes] - bioinformatics and functional genomics (Chapter 5, section 4, hidden Markov model)](/img/0d/77953ffa9f45a5acc16f02bf33293b.jpg)
November 22, 2021 [reading notes] - bioinformatics and functional genomics (Chapter 5, section 4, hidden Markov model)
随机推荐
期末复习-PHP学习笔记3-PHP流程控制语句
Final review -php learning notes 5-php array
CRM能为企业带来哪些管理提升
Bingbing learning notes: quick sorting
为什么大学毕业了还不知道干什么?
Go 数据类型篇之字符串及底层字符类型
National technology n32g45x series about timer timing cycle calculation
2022 retail industry strategy: three strategies for consumer goods gold digging (in depth)
Simple application of generating function
December 4, 2021 [metagenome] - sorting out the progress of metagenome process construction
2022.01.20 [bug note] | qiime2: an error was encoded while running dada2 in R (return code 1)
深度学习——词汇表征
Projection point of point on line
Distance from point to line
Cross compile opencv3.4 download cross compile tool chain and compile (3)
Why don't you know what to do after graduation from university?
Simple application of generating function -- integer splitting 2
期末複習-PHP學習筆記5-PHP數組
Halcon12+vs2013 C # configuration
Final review -php learning notes 2-php language foundation