DDD架构Repository体系类结构图
2021-06-03 23:40:53 14 举报
DDD架构
作者其他创作
大纲/内容
聚合
关联
组合
继承
LongId
# long value
+ ...
marker
依赖
User
- LongId id- Cname name- ...- Account account
实现
changeTracking
# DistributedLock distributedLock# Cache<T> cache# boolean autoCaching# span style=\"font-size: inherit;\
+ T find(ID id)+ void remove(T entity)+ void save(T entity)+ ...+ void attach(T aggregate)+ void detach(T aggregate)# String generateCacheKey(ID id)# T onSelect(ID id)# void onDelete(T aggregate)# void onInsert(T aggregate)# void span style=\"font-size: inherit;\
<>Type
user
Account
- LongId id- ...
+ T find(ID id)+ void remove(T entity)+ void save(T entity)+ ...
Entity<ID extends Identifier>
+ ID getId()+ void fillInId(ID id)+ Object snapshot()+ void validate()# void setId(ID id)+ void fillInId(ID id)
“+”表示public,“-”表示private,“#”表示protected,加粗表示接口的default方法和@Override方法,斜体表示抽象类和抽象方法
+ T find(ID id)+ void remove(T entity)+ void save(T entity)+ ...+ void attach(T aggregate)+ void detach(T aggregate)
<>Cache<T>
RangedLong
+ boolean existSnapshot(ID id)+ T removeSnapshot(ID id)+ void putSnapshot(T aggregate)+ T getSnapshot(ID id)
<>UserRepository
base
Cname
# String value
<>Identifiable<ID extends Identifier>
+ ID getId()+ void fillInId(ID id)
<>Identifier
+ String stringValue()
Aggregate<ID extends Identifier>
UserRepositoryImpl
- UserMapper userMapper- AccountMapper accountMapper
# DistributedLock distributedLock# Cache<T> cache# boolean autoCaching
+ T find(ID id)+ void remove(T entity)+ void save(T entity)+ ...# String generateCacheKey(ID id)# T onSelect(ID id)# void onDelete(T entity)# void onInsert(@NotNull T entity)# void onUpdate(@NotNull T entity)# ...
<>DistributedLock
+ void attach(T aggregate)+ void detach(T aggregate)+ void merge(T aggregate)+ EntityDiff detectChanges(T aggregate)+ boolean exist(ID id)+ T find(ID id)
@Cacheable
boolean autoCaching() = true
+ void attach(T aggregate)+ void detach(T aggregate)+ void merge(T aggregate)+ EntityDiff detectChanges(T aggregate)+ boolean exist(ID id)+ T find(ID id)
收藏
0 条评论
下一页