Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

Cqrs Ldnug 200100304

1.909 Aufrufe

Veröffentlicht am

Veröffentlicht in: Technologie, Bildung
  • Loggen Sie sich ein, um Kommentare anzuzeigen.

Cqrs Ldnug 200100304

  1. 1. CQRS, Related Patterns & Lessons Being Learned<br />
  2. 2. What’s ahead<br />Real quick overview of CQRS<br />Some related patterns<br />Event sourcing<br />Pub-sub<br />Experience Report from 2 CQRS projects (WIP)<br />1 Enterprise IT app in Insurance<br />1 cloud based app in Education<br />
  3. 3.
  4. 4.
  5. 5. Separate methods for<br />Commands & Queries<br />From: Object-Oriented Software Construction, 2nd Edition by Bertrand Meyer<br />
  6. 6. Technical Complexity<br />From: http://blog.fohjin.com/blog/2009/11/12/CQRS_a_la_Greg_Young<br />Complexity<br />Problem/Domain<br />
  7. 7. FaçadeClient<br />Bus<br />Commands<br />Eventually<br />Consistent<br />Queries<br />Handler<br />
  8. 8. Subscriber<br />Subscriber<br />Publisher<br />Subscribers<br />Subscriber<br />
  9. 9. ID : 123<br />Name : The Art of War<br />Author: Sun Tzu<br />ISBN: 1234ABCD5678<br />Event: BookIsbnChanged<br />NewValue: 4321DCBA8765<br />
  10. 10. …there are times when we don't just want to see where we are,<br />we also want to know how we got there<br />http://martinfowler.com/eaaDev/EventSourcing.html<br />
  11. 11. publicclassBook : AggregateRoot<Book><br /> {<br />privatestring _name;<br />privateIsbn _isbn;<br />privateGuid _id;<br />privateBook()<br /> {<br />Handle<IsbnChangedEvent>(HandleIsbnChangedEvent);<br /> }<br /> …<br />publicvoidChangeIsbn(ChangeIsbnCommandchangeIsbnCommand)<br /> {<br />// Check any relevant business rules here<br />IsbnChangedEvent @event = <br />newIsbnChangedEvent(_id, changeIsbnCommand.Isbn);<br />Apply(changeIsbnCommand);<br /> }<br />publicvoidHandleIsbnChangedEvent(IsbnChangedEvent @event)<br /> {<br /> _isbn = @event.NewIsbn;<br /> }<br /> }<br />
  12. 12. Experience Report 1:<br />Application to be used to let Brokers create quotes and policies<br />High Volume, low margin<br />Integration with legacy app for reporting<br />Legacy (& painful) Database<br />
  13. 13. Document Generator Gateway<br />DMS<br />Policy<br />Store<br />Rating<br />Data<br />Reference<br />Data<br />Legacy<br />Rating<br />Engine<br />Reports<br />Reference<br />Data<br />Documents<br />Domain & Plugins<br />Handlers<br />Façade – API (MVC)<br />Client Web App<br />
  14. 14. Experience Report 2:<br />Users are regional reps of an exam board<br />Globally located<br />Integrate with back office systems<br />Business benefit<br />Allow business to grow with growing costs<br />Provide a better service to customers<br />
  15. 15. Main<br />Event<br />Store<br />Reports<br />Reports<br />Handler<br />API<br />Handler<br />Query<br />API<br />Domain<br />API<br />Domain<br />Smart<br />Client<br />Web Client<br />
  16. 16. Now go see:<br />Videos<br />CQRS E-VANs - Greg Young, UdiDahan, Mark Nijhof<br />Event Sourcing - InfoQ Ian Cartwright<br />Blogs<br />Greg Young (CodeBetter)<br />UdiDahan<br />Mark Nijhof (Elegant Code)<br />Code Samples/Frameworks (all Event Sourced)<br />http://github.com/MarkNijhof/Fohjin (.NET)<br />http://github.com/erikrozendaal/cqrs-lottery (Java)<br />http://code.google.com/p/axonframework/ (Java)<br />