COLA框架--根据查询流程进行分析

根据查询流程进行分析
该项目在我的GitLab中为开源项目可下载;
http://112.125.89.38/colaintegration/cola-mysql-easyexcel.git

本框架涉及三个接口:

CustomerServiceI client层定义 app层实现;

接收数据adapter层数据,加工数据,通过executor对数据加工,调用用CustomerGateway接口;

CustomerGateway domain层定义 infrastructure层实现;

                               接收app层中转的数据,对数据加工,调用CustomerMapper接口;

CustomerMapper infrastructure层
本层xml实现;

获取CustomerGateway实现类传入的数据对数据库进行相应的操作,并返回相应的数据;

Start:

Java

Application 程序入口

resources数据库方面

application.properties 数据库设置,调用infrastructure中的TableCreationDDL.sql 创建cuctomer表;

logback-spring.xml 数据库日志设置;

demo-web-infrastructure:

java

DiamondConfig :

CreditGatewayImpl: 实现domain中的CreditGateway接口;实体Credit;

CustomerDO: Customer数据对象;

CustomerGatewayImpl 实现domain层中的 CustomerGateway 接口;实体Customer;

实现Customer类型的getByById()方法调用customerMapper.getById(customerId)从数据库中提取数据(方法实现在cuctomer-mapper.xml),给customerDO赋值;customerDO给(新声明,将返回的)Customer赋值;

App层实现

CustomerMapper 调用CustomerDO返回类型的getById;为CustomerGatewayImpl中customerDO赋值使用;

OrderGatewayImpl 未实现;

resources数据库方面

cuctomer-mapper.xml 实现cuctomer表操作;

mybatis-config.xml mybatis配置文件;

logback-spring.xml 数据库日志设置;

TableCreationDDL.sql 创建cuctomer表,及初始化数据;

demo-web-domain:

Java

CreditChecker 未实现

CreditGateway

CustomerGateway 接口;声明实体Customer类型方法getByById(),在 infrastructure层 CustomerGatewayImpl实现;

Class和Enum

CompanyType enum

Credit class实体类未实现;

Customer class实体类;

CustomerType enum

SourceType enum

demo-web-client:

Java/api

CustomerServiceI 接口;声明

addCustomer(CustomerAddCmd
customerAddCmd)

和listById(CustomerListByIdQry
customerListByIdQry)

两个方法;

CustomerAddCmd类定义于:dto/event

CustomerListByIdQry类定义于:dto/event

Java/dto

CustomerDTO 类

ErrorCode enum

CustomerAddCmd 封装customerDTO

CustomerListByIdQry 类;继承Query(查询)(继承Command继承DTO继承Serializable)

                                       封装customerId;

demo-web-app:

CustomerListByIdQryExe 通过CustomerGateway将CustomerListByIdQry变为List

CustomerAddCmdExe

CustomerServiceImpl 实现demo-web-client层CustomerServiceI接口;

                                                    ListById方法中使用到

demo-web-adapter:

CustomerMobileAdaptor 暂空;

CustomerWapAdaptor 暂空;

CustomerController 获取前端post/get操作;

customerListByIdQry CustomerServiceI MultiResponse

                 customerId                                       customer

                                             

           

                                                           提供CustomerServiceI接口以及DTO与前端数据封装类
























                                             CustomerGateway



                                    customerId                                customer  
































                   customerId               CustomerMapper        customerDO
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值