Coder Social home page Coder Social logo

ddd-sample-trade's Introduction

工程结构介绍

模块依赖关系

--------------              --------------
|            |              |            |
|   client   |              |  present   |
|            |              |            |
--------------              --------------
            \                 /        \
             \               /          \
              \             /            \
              _\|         |/_            _\|
              --------------               --------------                    --------------
              |            |               |            |                    |            |
              |     api    |               | application|                    |  resource  |
              |            |               |            |                    |            |
              --------------               --------------                    --------------
                                                         \                  /
                                                          \                /
                                                           \              /
                                                           _\|          |/_
                                                            --------------
                                                            |            |
                                                            |   domain   |
                                                            |            |
                                                            --------------

各模块职责

  • domain:领域服务层
    • 领域模型层:领域对象model、领域服务service、资源库repository、事件event、命令command
    • 查询处理器queryHandler
    • 代码结构如下
      - com.${company}.${department}.${business}.${appname}
      \- domain
        |- handler
        |- model
        |- service
        |- command
        |- event
        \- repository
      
  • application:应用服务层
    • 面向用例或用户故事,实现处理流程、处理节点
    • 代码结构如下
      - com.${company}.${department}.${business}.${appname}
      |- flow
      \- action
      
  • resource:资源层,实现数据访问
    • 含数据访问层dal、数据访问对象dao、数据库配置config、数据对象entity、数据映射mapper、数据对象&领域对象工厂
    • 代码结构如下
      - com.${company}.${department}.${business}.${appname}
      \- resource
        |- dal
        |- dao
        |- config
        |- entity
        |- mapper
        \- factory
      
  • api:公共api包,含公共常量&通用定义,服务接口定义
    • 公共常量const、枚举enum、通用util类、异常类
    • RPC服务接口定义Service
    • 输入输出对象:Request、Response、DTO
    • 代码结构如下
      - com.${company}.${department}.${business}.${appname}
      |- common
      | |- consts
      | |- enums
      | |- utils
      | \_ exception
      \- api
        |- module
        | |- request
        | |- response
        | \_ dto
        \_ service
      
  • client:实现富客户端
    • 富客户端
    • 代码结构如下
      - com.${company}.${department}.${business}.${appname}
      \_ client
      
  • present:用户接口层,即表现层(present),实现表现层逻辑(协议、输入&输出转换)
    • 定义present层接口(HTTP协议、RPC协议)
    • 代码结构如下
      - com.${company}.${department}.${business}.${appname}
      |- present
        |- rpc
        | \- impl
        \- web
          |- controller
          |- config
          \- filter
      

ddd-sample-trade's People

Contributors

dependabot[bot] avatar oleewen 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.