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

xMolecules

 xMolecules

Living architecture documentation

575ca492bac55e895d0e1c86f7d709fe?s=128

Henning Schwentner

May 04, 2022
Tweet

More Decks by Henning Schwentner

Other Decks in Programming

Transcript

  1. Starring Directed By Presented by With

  2. None
  3. Java old! C# ABAP PHP Python

  4. None
  5. https://hschwentner.io

  6. @hschwentner

  7. 👨💻‍‍‍ 👩💻‍‍‍ 👨💼‍‍‍ 💵

  8. @hschwentner

  9. BankAccount withdraw() deposit() Amount

  10. BankAccount withdraw() deposit() Amount

  11. @hschwentner Domain-Driven Design Eric Evans

  12. @hschwentner Entity vs. Value - Identity - Life cycle -

    Can be mutable - No identity - Always immutable Contract Map Name Amount Length 12.5 m $ 100.00 “John Miller”
  13. Entity Value Object Aggregate Service Factory Repository Tactical Design

  14. «Entity» BankAccount withdraw() deposit() «Value Object» Amount

  15. «stereotype» Value Object «stereotype» Entity ???

  16. xMolecules

  17. @hschwentner How To Express Architecture?

  18. class Account { public void deposit(Amount amount) //... public void

    withdraw(Amount amount) //... }
  19. class AccountEntity { public void deposit(Amount amount) //... public void

    withdraw(Amount amount) //... }
  20. class Account extends Entity<IBAN> { public void deposit(Amount amount) //...

    public void withdraw(Amount amount) //... }
  21. import org.jmolecules.ddd.types.Entity; class Account extends Entity<IBAN> { public void deposit(Amount

    amount) //... public void withdraw(Amount amount) //... }
  22. @Entity class Account { public void deposit(Amount amount) //... public

    void withdraw(Amount amount) //... }
  23. import org.jmolecules.ddd.annotation.Entity; @Entity class Account { public void deposit(Amount amount)

    //... public void withdraw(Amount amount) //... }
  24. @hschwentner Why Express Architecture?

  25. Documentation Verification Boilerplate Reduction

  26. @hschwentner Documentation

  27. @hschwentner 👨💻‍‍‍ 👩💻‍‍‍ «Entity» XXX «Value Object» YYY ??

  28. None
  29. @hschwentner Verification

  30. @hschwentner value Architecture Rules entity Acyclic Dependency Principle allowed forbidden

  31. None
  32. @AnalyzeClasses(packagesOf = ArchitectureTests.class) class ArchitectureTests { @ArchTest ArchRule ddd =

    JMoleculesDddRules.all(); }
  33. @hschwentner Boilerplate Reduction

  34. @javax.persistence.Entity class BankAccount { /*...*/ } @javax.persistence.???.Embeddable class Amount {

    /*...*/ }
  35. @hschwentner jmolecules-bytebuddy jmolecules-jpa jmolecules-spring jmolecules-jackson jmolecules-intellij

  36. None
  37. None
  38. None
  39. None
  40. Henning Schwentner ⌂ https://hschwentner.io @hschwentner ✉ hs@wps.de