Giter Site home page Giter Site logo

leave-sample's Introduction

leave-sample

一、说明

本代码源于极客时间《DDD实战课》,DDD知识体系和代码详解可参考专栏。

在《DDD实战课》专栏第18节中我们用事件风暴完成了“在线请假考勤”项目的领域建模和微服务设计。 我们一起从程序员的视角去看看用DDD方法设计和开发出来的微服务代码到底是什么样的?

二、项目回顾

“在线请假考勤”项目中,请假的核心业务流程是:“请假人填写请假单提交审批。根据请假人身份、请假类型和请假天数进行校验并确定审批规则。根据审批规则确定审批人,逐级提交上级审批,逐级核批通过则完成审批,否则审批不通过则退回申请人。”

在第18节的DDD领域建模和微服务设计中,我们已经拆分出了两个微服务:请假和考勤微服务。 本部分是请假微服务的示例代码,采用的开发语言和数据库分别是:Java、Spring boot和PostgreSQL。

三、请假微服务采用的DDD设计**

请假微服务中用到了很多DDD设计**和方法,主要包括以下几点。

1.聚合的管理:聚合根、实体和值对象的关系。

2.聚合数据的初始化和持久化:工厂和仓储模式。

3.聚合的解耦:聚合代码的解耦、跨聚合的服务调用和对象解耦。

4.领域事件管理:领域事件实体结构、持久化和事件发布。

5.DDD分层架构:基础层、领域层、应用层和用户接口层的协作。

6.服务的分层与协作:实体方法、领域服务、应用服务、接口服务,服务的组合和编排,跨多个聚合的服务管理和协同。

7.对象的分层和转换:DTO、DO和PO等对象在不同层的转换和实现过程。

8.微服务之间的访问:登录和认证服务。

leave-sample's People

Contributors

ouchuangxin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.