71. 灵活的注入和拦截
依赖注入Dependency Injection(DI or IOC)
@Service or @Component 能够进行彼此注入,通过其类构造器 (不支持
setter方法注入).
@Service or @Component也能被注入到 @Model 领域模型中,或者使
用 domain events.
面向方面编程Aspect-oriented programming(AOP)
使用@Introduce:
@Service or @Component 能够将彼此引入作为拦截器. @Model 能引
入任何 POJO 或 @Component作为它的拦截器
72. @Model内部机制
Client
xx.getA(“a”)
A
@Model
Interceptor for A
with @Introduce
B that need
implements interface
and has @Introduce
Inject proxy of B
Interceptor for B
with @Introduce
Cache container
C
Inject proxy of c
Component
In Context
Container
interceptor