So I'm trying to implement DDD and CQRS (no event source). I need clarity about the details of the implementation (Spring + JPA).
DDD with multiple small
added roots demand
@Entity classes with
I.D to maintain relationships that have explicit relationships. According to the effective aggregate design by Vaughn Vernon
My question is: if I want to implement a simple CQRS, do I need to duplicate all my JPAs?
Entities for both
I'm going with this.
- Separate read / write controllers
Command Servicein respective
Drivers to have a clear transfer in the project structure.
- InDomain& # 39; folder I keep my
Added entities(As well JPA
Repositories of added root.
- In Myself
InfrastructureI need to keep almost the same
(JPA Eager loading?) Or should I just write simple SQL queries? using
- You have my
Consultation serviceinside of me
- You have my
Command Serviceinside of me
Infrastructurecode where I will call domain repositories and domain services (as in this example, ddd for example) and call
Audit tables(simple events)
(no source of events because we can not admit that technology and we have little time and we are new to DDD and CQRS)
My question about the article 4) and if I write in queries vs alternative set of JPA If the queries about which JPA technologies are famous libraries will help to obtain secondary entities added by root easily? I know there is an exchange, but I need your thoughts a little bit of decision points.