Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit dc8d8a6

Browse files
committed
Add additional explanations
1 parent acde548 commit dc8d8a6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs-kb/simplified-cqrs-ddd/post.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ Why the separation? because the rules for **changing** the model can impose unne
2121

2222
In this simplified CQRS approach both the DDD model and the query model use the same database.
2323

24+
**Commands** and **Queries** are located in the Application layer, because:
25+
26+
1. It's where the composition of domain root aggregates occur (commands) and
27+
2. It's close to the UI requirements and has access to the whole database of the microservice (queries).
28+
29+
Ideally, root aggregates are ignorant of each other and it's the Application layer's responsibility to compose coordinated actions by means of domain events, because it knows about all root aggregates.
30+
31+
Regarding **queries**, in a similar analysis, the Application layer knows about all entities and relationships in the database, beyond the restrictions of the root aggregates.
32+
2433
Code
2534
----
2635

0 commit comments

Comments
 (0)