Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
CQRS Races Sagas
Domain
Model
Get dataGet data
Change dataUser is looking at
stale data
Data correct as of
10 minutes ago
List of customers
List of customers
Customer Service Rep view
ID Name Phone
List of customers
Supervisor view
ID Name Phone Lifetime value
Queries
Commands
DB
Service
Layer
Input
Validation Validation
Rules
Queries
View Model
View Model
Updater
Publish
Client
Cancel OrderShip Order
Rules:
1. Cannot cancel shipped orders
2. Don’t ship cancelled orders
public class Order
{
public void Cancel()
{
if (status != OrderStatusEnum.Shipped)
//cancel
}
public void Ship()
{
if (sta...
Looks like we’re stuck
The customer doesn’t want the products
No point in arguing
Rules:
1. Cannot cancel shipped orders
Because shipping costs money
That money would be lost if the customer cancelled
Bec...
www.NServiceBus.com
Queries
Commands
DB
Service
Layer
Input
Validation Validation
Rules
Queries
View Model
View Model
Updater
Publish
Client
CQRS Races Sagas
Domain
Model
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Cqrs race conditions_and_sagas_ohmy
Upcoming SlideShare
Loading in …5
×

Cqrs race conditions_and_sagas_ohmy

5,865 views

Published on

Published in: Technology, News & Politics
  • Be the first to comment

Cqrs race conditions_and_sagas_ohmy

  1. 1. CQRS Races Sagas Domain Model
  2. 2. Get dataGet data Change dataUser is looking at stale data
  3. 3. Data correct as of 10 minutes ago List of customers
  4. 4. List of customers Customer Service Rep view ID Name Phone List of customers Supervisor view ID Name Phone Lifetime value
  5. 5. Queries Commands DB Service Layer Input Validation Validation Rules Queries View Model View Model Updater Publish Client
  6. 6. Cancel OrderShip Order Rules: 1. Cannot cancel shipped orders 2. Don’t ship cancelled orders
  7. 7. public class Order { public void Cancel() { if (status != OrderStatusEnum.Shipped) //cancel } public void Ship() { if (status != OrderStatusEnum.Cancelled) //ship } }
  8. 8. Looks like we’re stuck
  9. 9. The customer doesn’t want the products No point in arguing
  10. 10. Rules: 1. Cannot cancel shipped orders Because shipping costs money That money would be lost if the customer cancelled Because we refund the customers money 2. Don’t ship cancelled orders
  11. 11. www.NServiceBus.com
  12. 12. Queries Commands DB Service Layer Input Validation Validation Rules Queries View Model View Model Updater Publish Client
  13. 13. CQRS Races Sagas Domain Model

×