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

xMolecules

 xMolecules

Living architecture documentation

Henning Schwentner

December 01, 2022
Tweet

More Decks by Henning Schwentner

Other Decks in Programming

Transcript

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

    Can be mutable - No identity - Always immutable Contract Map Name Length 12.5 m “John Miller”
  2. class Account : Entity { public void deposit(Amount amount) //...

    public void withdraw(Amount amount) //... }
  3. using NMolecules.DDD; class Account : Entity<IBAN> { public void deposit(Amount

    amount) //... public void withdraw(Amount amount) //... }
  4. [Entity] class Account { [Identity] public IBAN IBAN { get;

    } public void deposit(Amount amount) //... public void withdraw(Amount amount) //... }
  5. class Account extends Entity { public function deposit(Amount $amount) //...

    public function withdraw(Amount $amount) //... }
  6. /** * @extends Entity<IBAN> */ class Account extends Entity {

    public function deposit(Amount $amount) //... public function withdraw(Amount $amount) //... }
  7. use PHPMolecules\DDD\Type\Entity; class Account extends Entity { public function deposit(Amount

    $amount) //... public function withdraw(Amount $amount) //... }
  8. ???

  9. /** * @ORM\Entity * @ORM\Table(name="bank_accounts") */ class BankAccount { /**

    * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private IBAN iban; /*...*/ }
  10. // Install NMolecules.DDD as a Cake Addin #addin nuget:?package=NMolecules.DDD&version=0.2.1 //

    Install NMolecules.DDD as a Cake Tool #tool nuget:?package=NMolecules.DDD&version=0.2.1
  11. Bibliography Evans, Eric. Domain-Driven Design: Tackling Complexity in the Heart

    of Software. Boston: Addison-Wesley, 2004. Hofer, Stefan and Henning Schwentner. Domain Storytelling: a Collaborative, Visual, and Agile Way to Develop Domain-Driven Software. Boston: Addison-Wesley, 2022.