Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Fundamental Domain-Driven Design for Microservices

Fundamental Domain-Driven Design for Microservices

Slides of the talk I gave at JUG Saxony Day 2016.

@springcentral

Oliver Drotbohm

September 30, 2016
Tweet

More Decks by Oliver Drotbohm

Other Decks in Programming

Transcript

  1. © 2014 SpringOne 2GX. All rights reserved. Do not distribute

    without permission. DOMAIN-DRIVEN DESIGN / OLIVERGIERKE ƻ [email protected] FUNDAMENTAL FOR MICROSERVICES
  2. 2

  3. 5

  4. Stringly typed code 8 public class Customer { private Long

    id; private String firstname, lastname, email; … }
  5. Stringly typed code 9 public class SomeService { public void

    createUser(String firstname,
 String lastname, String email) { … } }
  6. 10 public class Customer { private Long id; private Firstname

    firstname; private Lastname lastname; private EmailAddress emailAddress; … }
  7. Still, they’re worth it. 12 See „Power Use of Value

    Objects in DDD“ by Dan Bergh Johnsson.
  8. 14 @Value public class Customer { UUID id = UUID.randomUUID();

    Firstname firstname; Lastname lastname; EmailAddress email; @Value static class EmailAddress { String value; } }
  9. 23 Shipping Accounting Catalog Orders User
 Registration Accounting Payment information

    Billing Address Shipping Shipping address Customer Product
  10. 32 Level 0: No events at all Level 1: Explicit

    operations Level 2: Some operations as events
  11. 34 Level 0: No events at all Level 1: Explicit

    operations Level 2: Some operations as events Level 3: Event Sourcing
  12. 37 Shipping Accounting Catalog Orders User
 Registration Accounting Payment information

    Billing Address Shipping Shipping address Customer Product