This presentation talks about Domain Driven Design and CQRS, Architectural Katas, Event Sourcing. It also discussed one Architectural Kata and tried to solve that.
3. Agenda
• We’ll try to analyze a problem and will try to solve this with DDD
• We’ll develop our Ubiquitous language
• Develop our model i.e. reflection of our Ubiquitous language
• Will find Entities, Value Objects & Aggregates
• Will try to break it down into commands, events and state
4. Architectural Katas
“How do we get great designers? Great designers design, of course.”
Fred Brooks
So how are we supposed to get great architects, if they only get the
chance to architect fewer than a half-dozen times in their career?
Ted Neward
5. Architectural Katas
• Kata is a detailed choreographed pattern of movement made to be
practice alone or in groups.
• Architects needs chance to practice, similar to how programmer
needs chance to practice
• Architectural Katas are architectural problems that needs to be run in
a group of 2-3 people.
• There are usually 4-10 groups
• Katas are generally run by a moderator
6. Architectural Katas
• Today we are going to pick one of the kata and try it out here in this
session.
• You can find more katas here https://archkatas.herokuapp.com
• We’ll run a full architectural katas session in one of our upcoming
meetup
7. Sysop Squad
• An electronics giant needs a new trouble-ticket system for their
customer-facing IT consultants (the Sysop Squad) in their stores
nationwide
• Requirements: trouble tickets can be entered by either call-center
receptionists, store staff or customers online; tickets route to the
appropriate consultant based on location, availability and skill;
customers enter consultant evaluation after service; consultant tracks
work performed in customer record(s) for future reference
• Users: thousands of customers, hundreds of consultants, hundreds of
store staff
8. Sysop Squad
• An electronics giant needs a new trouble-ticket system for their
customer-facing IT consultants (the Sysop Squad) in their stores
nationwide
• Requirements: Trouble Tickets can be entered by either call-center
Receptionists, Store Staff or Customers online; tickets route to the
appropriate Consultant based on location, availability and skill;
customers enter consultant evaluation after service; consultant tracks
work performed in customer record(s) for future reference
• Users: thousands of customers, hundreds of consultants, hundreds of
store staff
9. Sysop Squad
• An electronics giant needs a new trouble-ticket system for their
customer-facing IT consultants (the Sysop Squad) in their stores
nationwide
• Requirements: trouble tickets can be entered by either call-center
receptionists, store staff or customers online; tickets route to the
appropriate consultant based on location, availability and skill;
customers enter consultant evaluation after service; consultant
tracks work performed in customer record(s) for future reference
• Users: thousands of customers, hundreds of consultants, hundreds of
store staff
10. Identifying Entities & Value Objects
ENTITIES
• Ticket
• Receptionist
• Store Staff
• Customer
• Consultant
VALUE OBJECTS
• Consultant Evaluation
• Work Log
15. “All models are wrong; some models are useful”
George E. P. Box
16. CQRS
• Aren’t we missing something?
• If you see the model that we discussed, it only talks about commands
& events
• Once we have events, we can have an event listener to create state
• State is just a snapshot, it can be saved in Redis , CQEngine or SQL
store.
• On top of that we can have services that can be used to read the state
and respond to queries.