Cqrs intro
-
Upload
e2-partners -
Category
Software
-
view
239 -
download
3
description
Transcript of Cqrs intro
CQ(R)SCommand-Query Responsibility Segregation
The typical CRUD architecture
http://en.wikipedia.org/wiki/Multitier_architecture
Command and Query Soup
• MVC application: POST includes a command (intent to act) and returns a view based on a query.
• That doesn’t mean commands can’t have replies.Replies are in the form of “sure, I’ll do that” or “no problem, done”
Command Query Separation (CQS)
• Queries: Return a result and do not change the observable state of the system (are free of side effects).
• Commands: Change the state of a system but do not return a value.
Bertrand Meyer
More buzz words
• Domain Driven Design
• Event/Message Based design
• Distributed Applications
• EventSourcing
• Test Driven Development
Different kinds of ‘RS’
• EventSourcing + Reporting DB
• Different ViewModels for read and create/update (client level)
• Different databases or tables/views for read or write (DB level)
• …
The hexagonal architecture
http://alistair.cockburn.us/Hexagonal+architecture
Uncle Bob’s “Clean Architecture”
http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html
Examples & Sources
• CQRS Journeyhttp://msdn.microsoft.com/en-us/library/jj554200.aspx
• CQRS, the book (Mark Nijhof)https://github.com/MarkNijhof/Fohjin
• Lokad-CQRShttps://github.com/lokad/lokad-cqrs/
• CQRS (Martin Fowler)http://martinfowler.com/bliki/CQRS.html
• Clarified CQRS (Udi Dahan)http://www.udidahan.com/2009/12/09/clarified-cqrs/
Java Options
• Qi4j (framework for domain-centric application development)http://qi4j.org/
• Axon Framework (cqrs framework)http://www.axonframework.org/
• ServiceMixhttp://servicemix.apache.org/
• Don’t forget the roll-your-own-KISS-YAGNI solution!
Demo Technology Stack
• Topshelf
• NServiceBus
• NancyFx
• OWIN