何为数据
1.分为存储用,也分为传递用.
2. 一旦异步了就需要暂存数据,和 id.
3. 继承面向数据, 接口面向行为. 接口一种是因为有多种类型的相同行为(或者要处理不同的数据)所以需要接口. 1:n 的驱动 桥接模式,多种实现. 另外有可能是引擎,提供一种功能,抽象, 只要实现这个接口,就可以读取了. 0和1的关系. visotrt 模式.
有些桥接很简单, 各种渠道的数据都是一样的. 有些就比较复杂,比如支付渠道,不同的渠道的支付数据实体概念都是不同的. appid, clientIp,
需求层面:
不同点:
做业务系统的人首先关注的是 1.产品提出的业务,需要哪些数据存储. 流程从人的用例角度出发.
做中间件系统的人首先关注的是 1.各自中间件的用例方的需求和数据(大部分需要持久化保障). 2.从启动到关机的生命周期中不需要持久化有状态的数据.
相同点:
从较短生命周期看,都需要操作请求数据和返回数据.
从实现层面上 ,
不同点:
1.中间件系统需要自己在内存中用各种数据结构+Bean 来维护这些数据. 1.1 升级为内存数据库组件级别. 同时确保数据库四大特性. 原子性,一致性,隔离性,持久化不必须., 1.2 同时要求高并发, 读写分离,基于 id 加锁. 2.事务性 3.cas 4.
相同点:
其实本质上都是数据. 把数据分层,剥离. 即使是请求数据和返回数据. 也是可以分层的. 垂直拆分,水平拆分.引擎拆分. 支撑模块拆分(各流程强制拆分, 效率角度应对变化. 组织关系.) 1. 1对多的分层 1对1的剥离. 2.相同数据的抽取.下层