Presentation is loading. Please wait.

Presentation is loading. Please wait.

Domain Modelling Paul Stovell. Architecture: Implicit or Explicit? Architecture exists implicitly But if you don’t define it, it probably sucks.

Similar presentations


Presentation on theme: "Domain Modelling Paul Stovell. Architecture: Implicit or Explicit? Architecture exists implicitly But if you don’t define it, it probably sucks."— Presentation transcript:

1 Domain Modelling Paul Stovell

2 Architecture: Implicit or Explicit? Architecture exists implicitly But if you don’t define it, it probably sucks

3 Scope of this presentation UI Data Stores (Database, Web Service, etc.)

4 Domain Modelling Step 1: Understand the problem domain Step 2: Architect around it

5 Object-Oriented Design Encapsulation Polymorphism Inheritance Abstraction

6 Design Patterns Gang of Four Concepts Judgement As simple as possible, but no simpler

7 Object Oriented not Class Oriented

8 Domain Model What’s in a domain model? Stateful Objects Services Responsibilities: Maintaining their own state Responsibilities: Maintaining their own state Responsibilities: Doing stuff Responsibilities: Doing stuff

9 Entities : Stateful Objects Have a real-world identity

10 Value Objects : Stateful Objects Have no real-world identity Value objects with same values are interchangeable

11 Value Objects : Stateful Objects Value objects are subjective

12 Domain Services : Stateless Responsibilities: Doing stuff Generally stateless

13

14 Relationship Bias Most real-world relationships are one-way

15

16 Aggregates Recognise that some things don’t exist without others

17 Aggregates Timesheet TimesheetEntry Customer Aggregate Timesheet

18 Locking Timesheet TimesheetEntry Customer Coarse-Grained Lock

19 Aggregates Timesheet TimesheetEntry Customer Aggregate

20

21 Context and Boundaries “Object models don’t scale”

22 Contexts and Boundaries Sales Application Context Tech Support Application Context Boundary

23 Gateways Abstract the coordination of services and stateful objects Like your manager: they boss people around but don’t do any work themselves

24

25 Domain Models + SOA UI Service Agents Web Services Business Logic Database Service Messages UI Service Agents Web Services Business Logic Database Service Messages

26 Domain Models + SOA UI Service Agents Web Services Domain Services Database Domain Objects UI Service Agents Web Services Domain Services Database Domain Objects

27 Recap What’s in a domain model? – Stateful Objects Entities Value Objects – Services Simplified by: – Relationship Bias – Aggregates Scales thanks to: – Contexts and Boundaries – Gateways

28 I’m still awake! Where can I get more? Head first design patterns Eric & Elizabeth Freeman Domain Driven Design Eric Evans Patterns of Enterprise Application Architecture Martin Fowler

29 CHEERS! Paul Stovell www.paulstovell.net paul.stovell@readify.net July 5 th SDNUG (AMP Building) Binding Oriented Programming www.sdnug.org


Download ppt "Domain Modelling Paul Stovell. Architecture: Implicit or Explicit? Architecture exists implicitly But if you don’t define it, it probably sucks."

Similar presentations


Ads by Google