This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CQRS is not complicated - complex architectures are complicated, and they're complicated because we make them complicated | |
------------------- | |
CQRS is not a complicated architecture, CQRS just means maintaining a healthy division of responsibilities between reads and writes across your system - that is, having the reads in your system executed in a thin clean manner appropriate to the views you want to retrieve, and your writes going through all the crazy logic you need such as validation, updating queues, third party systems, processing business rules - whatever. | |
CQRS can be achieved by using a document database like Raven or Couch - using your documents as a write store, using your indexes as a query store. It can be achieved with your favourite ORM (Even better if you can actually use that O and that M and get some good old OO going) - if you want to use your objects for encapsulating business logic and go directly to the the queries to project the data you need for views (HQL, SQL directly, SPROCS, whate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ReducedController : Controller | |
{ | |
private readonly IContainProducts productRepository; | |
private readonly ISearchForProducts productsIndex; | |
private readonly IContainCustomers customerRepository; | |
private readonly IShipProducts productShipper; | |
private readonly ICoordinateSales salesCatalog; | |
public ReducedController( | |
IContainProducts productRepository, |
NewerOlder