46
Unleash Your Domain Greg Young

Unleash Your Domain With Greg Young

Embed Size (px)

Citation preview

Page 1: Unleash Your Domain With Greg Young

Unleash Your Domain

Greg Young

Page 2: Unleash Your Domain With Greg Young

Agenda

• The Issues• The Breakthroughs– Explicit State Representation– Event Storage – Command Query Separation– Asynchronous Context Mapping

• Summary• Questions

Page 3: Unleash Your Domain With Greg Young
Page 4: Unleash Your Domain With Greg Young
Page 5: Unleash Your Domain With Greg Young
Page 6: Unleash Your Domain With Greg Young
Page 7: Unleash Your Domain With Greg Young
Page 8: Unleash Your Domain With Greg Young

State transitions are an important part of our problem space and should be modeled within

our domain.

Page 9: Unleash Your Domain With Greg Young
Page 10: Unleash Your Domain With Greg Young

Purchase Order

Line Items (n)

Shipping Information

Page 11: Unleash Your Domain With Greg Young

Cart Created 3 Items Added

Shipping Information

Added

Page 12: Unleash Your Domain With Greg Young

Purchase OrderAddItemCommand

ChangeAddressCommand

AddItemCommandAddItemCommand

Page 13: Unleash Your Domain With Greg Young
Page 14: Unleash Your Domain With Greg Young

Cart Created 3 Items Added

1Item Removed

Shipping Information

Added

Page 15: Unleash Your Domain With Greg Young
Page 16: Unleash Your Domain With Greg Young

6

5

4

3

2

1

7

Page 17: Unleash Your Domain With Greg Young

5

snap

4

3

2

1

6

Page 18: Unleash Your Domain With Greg Young
Page 19: Unleash Your Domain With Greg Young
Page 20: Unleash Your Domain With Greg Young

Application Services

Data Storage

Domain Object

Client

Remote Facade

Request DTODTO returned

Send up DTOStatus returned

Domain Object

Page 21: Unleash Your Domain With Greg Young

DTO SentAck/Nak Response

Request DTODTO returned

Send DTO Back to Server

Show DTO on Screen

User Interacts With DTO

Page 22: Unleash Your Domain With Greg Young

Map DTO from Domain

Edit DTO in UI

Send DTO to Server

Map Data from DTO to Domain

Save Domain Object(s)

Page 23: Unleash Your Domain With Greg Young

Query Data

Build Commands

Send Commands to Domain

Domain Validates Commands

Save Domain Object(s)

Page 24: Unleash Your Domain With Greg Young

Data Storage

Application Services

Domain Object

Remote Facade

Domain Object

Client

Message SentAck/Nak Response

Thin Read Layer (Direct to DTO)

Remote Facade

Request DTODTO returned

Page 25: Unleash Your Domain With Greg Young

Data Storage

Application Services

Domain Object

Remote Facade

Domain Object

Client

Message SentAck/Nak Response

Thin Read Layer (Direct to DTO)

Remote Facade

Request DTODTO returned

Write (Command) Read (Query)

Page 26: Unleash Your Domain With Greg Young

A single model cannot be appropriate for reporting, searching, and transactional

behaviors…

Page 27: Unleash Your Domain With Greg Young
Page 28: Unleash Your Domain With Greg Young
Page 29: Unleash Your Domain With Greg Young

The model that a client needs the data in a distributed system is screen based and different

than the domain model.

Page 30: Unleash Your Domain With Greg Young
Page 31: Unleash Your Domain With Greg Young

Most queries can operate with relaxed consistency…

Page 32: Unleash Your Domain With Greg Young

Data Storage

Application Services

Domain Object

Remote Facade

Domain Object

Thin Read Layer (Direct to DTO)

Remote Facade

Data Storage

Pipeline

Client

Denormalizer -------------------

Anti Corruption

Page 33: Unleash Your Domain With Greg Young
Page 34: Unleash Your Domain With Greg Young

Getters and Setters are a domain anti-pattern.

Page 35: Unleash Your Domain With Greg Young
Page 36: Unleash Your Domain With Greg Young
Page 37: Unleash Your Domain With Greg Young
Page 38: Unleash Your Domain With Greg Young

Most Bounded Contexts can interact with relaxed consistency.

Page 39: Unleash Your Domain With Greg Young
Page 40: Unleash Your Domain With Greg Young

Using relaxed consistency allows us to increase our scalability and availability!

Page 41: Unleash Your Domain With Greg Young

“Man acts as though he were the shaper and master of language, while in fact it is language that is the master of man.”

Page 42: Unleash Your Domain With Greg Young

State transitions are an important part of our problem space and should be modeled within

our domain.

Page 43: Unleash Your Domain With Greg Young

Getters and Setters are a domain smell.

Page 44: Unleash Your Domain With Greg Young

Most Bounded Contexts can interact with relaxed consistency.

Page 45: Unleash Your Domain With Greg Young

A single model cannot be appropriate for reporting, searching, and transactional

behaviors…

Page 46: Unleash Your Domain With Greg Young

Questions