title: How to structure separation and namespaces in CQRS?
body: <p>I'm looking for advice on how to structure namespaces in a CQRS structured application.</p>
  
  <p>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.</p>
  
  <p>Currently the structure has the following folders which each contains the implementation:</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>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.</p>
  
  <p>There is no overlap in the aggregates of the query-side and command-side.</p>
  
  <p>In a refactoring to a separation, where should the slice be made?</p>
  
  <h2>Suggestion 1</h2>
  
  <p>A full slice resulting in a query and a command-side which means that even the Application layer has read and write side.</p>
  
  <h2>Suggestion 2</h2>
  
  <p>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.</p>
  
  <p>Please make a 3rd suggestion, if mine do not apply. Thanks.</p>