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 JAX 2016, Mayence.

@springcentral

Oliver Drotbohm

April 19, 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] GRUNDLEGENDES FÜR MICROSERVICES
  2. 2

  3. 6

  4. 6

  5. Stringly typed code 9 public class Customer { private Long

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

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

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

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

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

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

    operations Level 2: Some operations as events
  12. 37 Level 0: No events at all Level 1: Explicit

    operations Level 2: Some operations as events
  13. 37 Level 0: No events at all Level 1: Explicit

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

    Billing Address Shipping Shipping address Customer Product