Your SlideShare is downloading. ×
0
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

CQRS - Eine Einführung - NOUG 2011

835

Published on

Published in: Self Improvement, Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
835
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
12
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. CQRS – Eine Einführung .Net Online Usergroup – 10.10.2011 Presenter: Dennis Traub Speaker, Author, Software Developer since 1991 Currently at ProAvia GmbH, Stuttgart Twitter: @DTraub
  • 2. What CQRS is NOT
  • 3. DDD revisitedUsual Patterns ▫ Entities ▫ Value Objects ▫ Repositories
  • 4. DDD revisitedSome Important Patterns ▫ Ubiquitous Language ▫ Bounded Contexts ▫ Core Domain ▫ Domain Experts
  • 5. DDD RevisitedAn Example: Competitive advantage through an efficient online claims procedure
  • 6. DDD revisitedDO use DDD: ▫ Where we get competitive advantage
  • 7. DDD revisitedDO use DDD: ▫ Where we get competitive advantageDON‘T use DDD ▫ When there‘s no value in formalizing the problem
  • 8. DDD revisited• The point of DDD is not Software Analysis
  • 9. DDD revisited• The point of DDD is not Software Analysis• It‘s Business Analysis
  • 10. „Best-Practice“ Architecture
  • 11. „Best-Practice“ Architecture
  • 12. „Best-Practice“ Architecture• Pros: ▫ Easy to build ▫ Accepted by management ▫ Well known
  • 13. „Best-Practice“ Architecture• Cons: ▫ Limited scalability ▫ Loss of intent ▫ Lazy Loading ▫ Data Projection ▫ Pain ▫ And: If Domain is only CRUD, where does Business Logic live?
  • 14. Domain Model Responsibilities• Business Logic• Validation• Structure• Associations• Scopes, Filters• Aggregation• Presentation• Persistence• Lazy / Eager Loading• …
  • 15. The S in SOLID
  • 16. Read vs. Write• Reads and Writes are completely different from eachother• Why do we try to build the One Model to Rule Them All?• Sometimes it‘s cheaper to do two things than dealing with the trade-offs
  • 17. Command-Query Separation• Bertrand Meyer: ▫ Every method should either be a command that performs an action, or a query that returns data to the caller• In other words: ▫ Asking a question should not change the answer.
  • 18. CQS on an Architectural Level Queries Commands Project Project Project Details List Data Storage
  • 19. Basic CQRS Architecture Data Storage ORM Thin Read Layer Domain Model Command Handlers Commands Queries Client
  • 20. The Parts: Thin Read Layer• Concerns: ▫ Filtering, Scope ▫ Data Presentation• Attributes ▫ Data-Oriented ▫ Indexable ▫ Can be Denormalized for fast access ▫ Only Structure
  • 21. The Parts: Domain Model• Concerns: ▫ Validation ▫ Business Logic• Attributes: ▫ Normalized ▫ Object Oriented ▫ Transactional ▫ Persistence Ignorant ▫ Only Behaviour
  • 22. The Parts: Task-Based UI
  • 23. The Parts: Task-Based UI
  • 24. The Parts: Task-Based UI
  • 25. The Parts: CommandsRefactoring: Application Service Calls to ObjectsCommands: ▫ Are Serializable ▫ Can be enveloped ▫ Can be intercepted ▫ Can be enriched ▫ Communicate intent
  • 26. The Parts: Command HandlersRefactoring: Application Service to Command HandlerCommand Handlers: ▫ Unify interface to all application services ▫ Can be wrapped (e.g. Transaction, Authorization, Logging, etc.) ▫ Can be enveloped (e.g. RESTful Envelope) ▫ Rule of Thumb: One Command Handler per Use Case
  • 27. This is CQRS! Complicated? Data Storage ORM Thin Read Layer Domain Model Command Handlers Commands Queries Client
  • 28. But what about Eventual Consistency?
  • 29. The First Rule Source: www.kinoweb.de
  • 30. CQRS can be perfectly consistent! Data Storage ORM Thin Read Layer Domain Model Command Handlers Commands Queries Client
  • 31. Advanced topics for another day• Events• Sagas• Event Log• Messaging• Service Busses• NoSQL• Event Store
  • 32. Thanks! Dennis Traub @DTraub
  • 33. Resources• cqrsinfo.com• groups.google.com/group/dddcqrs• distributedpodcast.com

×