Git Product home page Git Product logo

code_org's Introduction

代码分层

参考代码分层文档,理清代码分层的演进过程,整理出适合自己的代码分层架构。

框架有弹性,可适配简单项目和复杂项目。

对象定义

目录含义

  • model/po 对应“存储层”的结构体,是对存储的一一映射。
  • dal 数据读写层,统一处理数据库。
  • conf 服务配置文件。
  • service 基本业务逻辑。
  • app 传统的service, 对基本业务逻辑编排。
  • handler 入口层,参数校验。
  • constant 常量定义
  • message mq异步消息入口
  • cron 脚本服务入口
  • task 包含异步任务的编排。
  • convert 各种对象的转换
  • bo 业务对象
  • dto 传输对象
  • vo 视图对象
  • util 工具
  • rpc 外部业务服务
  • infra 公司中台服务
  • repo 聚合层,屏蔽rpc, infra细节
  • script 脚本

开发流程

简单复杂度项目

参与的对象

po->vo dto->po

参与的层

中等复杂度项目

参与的对象

dto->bo->do->po

参与的层

参考文章

code_org's People

Contributors

zhoupro 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.