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

Tactical Modelling Workshop

Adelina
January 31, 2024

Tactical Modelling Workshop

Adelina

January 31, 2024
Tweet

Transcript

  1. OVERVIEW ▪ DDD Tactical Modeling Overview ▪ Tactical Modelling Terms

    ▪ Entities ▪ Aggregates ▪ Identify services ▪ Practical example ▪ Build diagrams for each context
  2. Tactical Modeling Overview Tactical Modeling is applied within a Bounded

    Context Tactical Modeling relies on Ubiquitous Language Aggregates – central tactical pattern An Aggregate is composed of either a single Entity or a cluster of Entities and Value Objects that must remain transactionally consistent throughout the Aggregate’s lifetime An Aggregate is persisted and queried using its Repository
  3. Tactical Modeling Overview Domain Services - Business operations inside the

    Domain Model that don’t fit naturally as an operation on an Entity or a Value Object Domain Events – model significant occurrences in the domain Modules - logical grouping of objects (Java packages, C# namespaces)
  4. Ways to discover Entities Starting from DB tables – wrong

    way, resulting in relational model in the code Start from the language (Ubiquitous Language)
  5. Entity Construction The following information must be provided during Entity

    construction: • Identity information • Attributes used for querying • Any other information that satisfies the Entity Invariant
  6. Aggregates Design Rules Protect business invariants inside Aggregate boundaries. Design

    Small Aggregates Reference other Aggregates by Identity Use Eventual Consistency outside the Aggregate’s boundary
  7. Reference Other Aggregates by Identity Tempted to modify it within

    the same transaction If Aggregates are referenced directly, query performance will be affected
  8. Design small aggregates Large cluster limits scalability and performance Limit

    the Aggregate to Aggregate Root and several Value Typed (prefer Value Objects over Entities) Attributes or any other necessary minimum. Necessary means – those attributes which must be consistent with others. Don’t be confused by “has” relationship
  9. Identify services Start from ubiquitous language 1 Identify business operations

    inside domain 2 Distinguish between infrastructure and domain 3