quot;Everything
should
be
made

as
simple
as
possible,

but
not
simpler.quot;

Albert Einstein
Chaos
Order
Focus
Create a world
with laws
Be aware of the
environment
Basic types for the world
Value objects
Value objects
• Represents a value

• No identity

• immutable

• Equality by value
good example
...or not
All the same
Entities
 Meet Bob
Hi, my name is
     Bob
I'm 32 years old
...and I'm a
starshiptrooper
Meet bob
Hi, my name is
    Bob too
I'm also 32
 years old
...and also a
starshiptrooper
Identity
Identity
• Combination of properties

• Personal number
Aggregate Root
Domain
Model by
Example
Student
Student




          Class
Student




Teacher             Class
Mayor         Address


                  Student




Teacher                           Class
Mayor         Address


                  Student




Teacher                                      Class


               ...
Mayor         Address


                                 Student




         Teacher                                     ...
Mayor         Address


                                 Student




         Teacher                                     ...
Mayor         Address


                                 Student




         Teacher                                     ...
Mayor         Address


                                 Student




         Teacher                                     ...
Mayor         Address


                                 Student




         Teacher                                     ...
Validation
Validation
•  Validatable objects

•  !invariant object
Validatable object
•  Default ctor
•  Supported by a lot of frameworks
•  Flexible

•  Naive
!Invariant object
•  No default ctor, most of the time
•  Nonflexible

•  Strict!
distortion
Active-Passive
Repositories
Storage
Services
Tight, small and focused
Service
layer?
Service layers are c00l
•  Support multiple application

•  Your domain is in the center
   of the world

•  Huge envirome...
Service layers are bad, mkay
•  Domain logic is boxed

•  Logic duplication

•  No direct feedback

•  Databinding support!
Bootstrapping
Overview
Domain
DB




Domain
DB




UI   Domain
Service             DB




               Storage




UI             Domain
Service             DB




               Storage




UI             Domain




               Logging
Service             DB




               Storage




                              Service
UI             Domain         ...
Service             DB




               Storage




                              Service
UI             Domain         ...
Service             DB




                           Storage


 UI




          UI                              Service
...
Service             DB




                                 Storage


 UI




          UI                                ...
Inversion of control
You only want beer
Learn more
DISCUSSION
You were great!
  Really, I already knew it when creating this slide
Domain Driven Design fundamentals
Domain Driven Design fundamentals
Domain Driven Design fundamentals
Domain Driven Design fundamentals
Domain Driven Design fundamentals
Domain Driven Design fundamentals
Domain Driven Design fundamentals
Domain Driven Design fundamentals
Domain Driven Design fundamentals
Domain Driven Design fundamentals
Domain Driven Design fundamentals
Domain Driven Design fundamentals
Domain Driven Design fundamentals
Domain Driven Design fundamentals
Domain Driven Design fundamentals
Domain Driven Design fundamentals
Domain Driven Design fundamentals
Domain Driven Design fundamentals
Domain Driven Design fundamentals
Domain Driven Design fundamentals
Domain Driven Design fundamentals
Domain Driven Design fundamentals
Domain Driven Design fundamentals
Upcoming SlideShare
Loading in...5
×

Domain Driven Design fundamentals

2,955

Published on

Published in: Technology, Business
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,955
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
177
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Transcript of "Domain Driven Design fundamentals"

  1. 1. quot;Everything
should
be
made
 as
simple
as
possible,
 but
not
simpler.quot;
 Albert Einstein
  2. 2. Chaos
  3. 3. Order
  4. 4. Focus
  5. 5. Create a world
  6. 6. with laws
  7. 7. Be aware of the environment
  8. 8. Basic types for the world
  9. 9. Value objects
  10. 10. Value objects • Represents a value • No identity • immutable • Equality by value
  11. 11. good example
  12. 12. ...or not
  13. 13. All the same
  14. 14. Entities Meet Bob
  15. 15. Hi, my name is Bob
  16. 16. I'm 32 years old
  17. 17. ...and I'm a starshiptrooper
  18. 18. Meet bob
  19. 19. Hi, my name is Bob too
  20. 20. I'm also 32 years old
  21. 21. ...and also a starshiptrooper
  22. 22. Identity
  23. 23. Identity • Combination of properties • Personal number
  24. 24. Aggregate Root
  25. 25. Domain Model by Example
  26. 26. Student
  27. 27. Student Class
  28. 28. Student Teacher Class
  29. 29. Mayor Address Student Teacher Class
  30. 30. Mayor Address Student Teacher Class Location Material
  31. 31. Mayor Address Student Teacher Class Schema Payroll Location Material
  32. 32. Mayor Address Student Teacher Class Schema Payroll Location Material
  33. 33. Mayor Address Student Teacher Class Schema Payroll Location Material
  34. 34. Mayor Address Student Teacher Class Schema Payroll Location Material
  35. 35. Mayor Address Student Teacher Class Schema Payroll Location Material
  36. 36. Validation
  37. 37. Validation •  Validatable objects •  !invariant object
  38. 38. Validatable object •  Default ctor •  Supported by a lot of frameworks •  Flexible •  Naive
  39. 39. !Invariant object •  No default ctor, most of the time •  Nonflexible •  Strict!
  40. 40. distortion
  41. 41. Active-Passive
  42. 42. Repositories
  43. 43. Storage
  44. 44. Services Tight, small and focused
  45. 45. Service layer?
  46. 46. Service layers are c00l •  Support multiple application •  Your domain is in the center of the world •  Huge enviroments •  Read DTO's •  Write command
  47. 47. Service layers are bad, mkay •  Domain logic is boxed •  Logic duplication •  No direct feedback •  Databinding support!
  48. 48. Bootstrapping
  49. 49. Overview
  50. 50. Domain
  51. 51. DB Domain
  52. 52. DB UI Domain
  53. 53. Service DB Storage UI Domain
  54. 54. Service DB Storage UI Domain Logging
  55. 55. Service DB Storage Service UI Domain bus Logging
  56. 56. Service DB Storage Service UI Domain bus Logging
  57. 57. Service DB Storage UI UI Service model Domain bus Beheer Logging
  58. 58. Service DB Storage UI UI Service model WCF Domain bus Beheer Logging
  59. 59. Inversion of control You only want beer
  60. 60. Learn more
  61. 61. DISCUSSION
  62. 62. You were great! Really, I already knew it when creating this slide
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×