I'm looking for advice on how to structure namespaces in a CQRS structured application.
Currently the command-side and the query-side are in the same namespace in each bounded context, but as complexity is growing, it is starting to create problems.
Currently the structure has the following folders which each contains the implementation:
Application
+ Api
+ Cli
+ Web
Domain
+ Action (Command and Command Handlers in one - we are not using a CommandBus)
+ Event
+ Model
+-- Project
|-- Project.file
|-- ProjectRepository.file
Infrastructure
+ Consumer (Projections and ProcessManagers)
+ EventStore
+ Persistance (Denormalized read side)
+-- Project
|-- SqlProjectRepository.file
Common (Supporting namespace)
The issue is now that the Domain Model currently contains both the entities and event sourced aggregate root which are essentially only part the query-side and command-side, respectively.
There is no overlap in the aggregates of the query-side and command-side.
In a refactoring to a separation, where should the slice be made?
Suggestion 1
A full slice resulting in a query and a command-side which means that even the Application layer has read and write side.
Suggestion 2
A slice which is only made on the Domain layer so that the query side contains the (quite anemic) entities of the read model and the command-side holds events, event sourced aggregate root and more.
Please make a 3rd suggestion, if mine do not apply. Thanks.