SlideShare una empresa de Scribd logo
1 de 47
Domain-Driven Design

     Dennis Traub
           @dtraub
     #devspace 2012-10-19
Domain
  A sphere of knowledge, influence, or activity.

  What an organization does and the world it does it in.
Model
  A system of abstractions that describes selected
  aspects of a Domain and can be used to solve
  problems related to that Domain.
don‘t model reality
we model useful abstractions of
reality
Ubiquitous Language
  A Language structured around the Domain Model
  and used by all team mebers.
Bounded Context
  An explicit Boundary within which a Domain
  Model exists.

  Inside the boundary all terms have specific meaning.
  They are part of the context‘s Ubiquitous Language.
BC Example: Online-Shop
  E-Commerce-System
  Inventory System
  Accounting
Subdomains
  The whole Domain of the organization is comprised
  of Subdomains.

  They focus on only one specific area of the whole
  business Domain.
Subdomain Example:
  Product Catalog
  Customer Management
  Orders
  Invoicing
  Inventory
  Shipping
don‘t build a model that
works for everyone
Core Domain
  The distinctive part of the Model, central to the user‘s
  goals, that differentiates the application and makes it
  valuable.

  The most important Subdomain.
Question # 1:

Which subdomain creates the greatest
competitive advantage?
Question # 2:

Which subdomain has the highest complexity?
we don‘t     use DDD when
there‘s no value in formalizing
the problem
we only use DDD in parts where
we get a competitive advantage
Aggregate
  A cluster of associated objects that are treated as a
  unit for the purpose of data changes.

  A set of consistency rules applies within the
  Aggregate‘s boundaries.
Exercise # 1: A simple Model
  We have Students, Courses, and Teachers
  A Student can take multiple Courses
  A Course can have multiple Students
  A Course is hosted by a Teacher
  A Teacher can host multiple Courses
public class Teacher
{
    public List<Course> Courses { get; private set; }
}


public class Course
{
    public Teacher Teacher { get; private set; }
    public List<Student> Students { get; private set; }
}

public class Student
{
    public List<Course> Courses { get; private set; }
}
Exercise # 2: Assign Teacher
  A Course ist hosted by a Teacher

  Constraint: A Teacher has a maximum number of
  students
public class Teacher
{
    public List<Course> Courses { get; private set; }
    public int MaximumNumberOfStudents { get; private set; }

    public void Assign(Course course) {
        if (course.Students.Count >= MaximumNumberOfStudents)
            throw ...
        this.Courses.Add(course);
        course.AssignTo(this);
    }
}

public class Course
{
    public Teacher Teacher { get; private set; }
    public void AssignTo(Teacher teacher) {
        this.Teachers.Add(teacher);
    }
}
public class Teacher
{
    public List<Course> Courses { get; private set; }
    public int MaximumNumberOfStudents { get; private set; }

    public void Assign(Course course) {
        if (course.Students.Count >= MaximumNumberOfStudents)
            throw ...
        this.Courses.Add(course);
        course.AssignTo(this);
    }
}

public class Course
{
    public Teacher Teacher { get; private set; }
    public void AssignTo(Teacher teacher) {
        this.Teachers.Add(teacher);
    }
}
Pattern # 1: Responsibility

  We don‘t know where to put things.

  Responsibilities must be clear.

  Have one way of doing something, not many.
public class Teacher
{
    public List<Course> Courses { get; private set; }
    public int MaximumNumberOfStudents { get; private set; }

    public void Assign(Course course) {
        if (course.Students.Count >= MaximumNumberOfStudents)
            throw ...
        this.Courses.Add(course);
        // course.AssignTo(this);
        course.Teacher = this;
    }
}

public class Course
{
    public Teacher Teacher { get; private set; }
    /* public void AssignTo(Teacher teacher) {
         this.Teachers.Add(teacher);
    } */
}
public class Teacher
{
    public List<Course> Courses { get; private set; }
    public int MaximumNumberOfStudents { get; private set; }

    public void Assign(Course course) {
        if (course.Students.Count >= MaximumNumberOfStudents)
            throw ...
        this.Courses.Add(course);
        // course.AssignTo(this);
        course.Teacher = this;
    }
}

public class Course
{
    public Teacher Teacher { get; private set; }
    /* public void AssignTo(Teacher teacher) {
         this.Teachers.Add(teacher);
    } */
}
Pattern # 2: Don‘t be stupid
  No rules on Teacher.Courses or Course.Teacher.

  We don‘t need the relationship.
don‘t model reality
public class Teacher
{
    public List<Course> Courses { get; private set; }
    public int MaximumNumberOfStudents { get; private set; }

    /* public void Assign(Course course) {
        if (course.Students.Count >= MaximumNumberOfStudents) throw ...
        this.Courses.Add(course);
        course.AssignTo(this);
    } */
}

public class Course
{
    // public Teacher Teacher { get; private set; }
    public int MaximumNumberOfStudents { get; private set; }

    public void AssignTo(Teacher teacher) {
        if (Students.Count >= teacher.MaximumNumberOfStudents)
            throw ...

        MaximumNumberOfStudents = teacher.MaximumNumberOfStudents;
    }
}
But what if ...
   What happens if the Teacher changes his/her
   maximum number of students?
New Use Case.
Ask the Domain Expert
Exercise # 3: Enroll Student
  A Student can enroll in a Course

  Constraint: A Student can only enroll in up to five
  Courses

  Constraint: A Student‘s Courses may not overlap
public class Course
{
    public int MaximumNumberOfStudents { get; private set; }
    public void Students { get; private set; }

    private void TryEnroll(Student student) {
        if (Students.Count() >= MaximumNumberOfStudents) throw ...
    }

    public void Enroll(Student student) {
        this.TryEnroll(student);
        student.TryEnroll(this);
        this.Students.Add(student);
        student.EnrollIn(this);
    }
}

public class Student
{
    public List<Course> Courses { get; private set; }

    public void TryEnrollIn(Course course) {
        foreach (var c in Courses) {
            if (c.OverlapsWith(course)) throw ...
        }
    }

    public void EnrollIn(Course course) {
        this.Courses.Add(course);
    }
}
public class Course
{
    public int MaximumNumberOfStudents { get; private set; }
    public void Students { get; private set; }

    private void TryEnroll(Student student) {
        if (Students.Count() >= MaximumNumberOfStudents) throw ...
    }

    public void Enroll(Student student) {
        this.TryEnroll(student);
        student.TryEnroll(this);
        this.Students.Add(student);
        student.EnrollIn(this);
    }
}

public class Student
{
    public List<Course> Courses { get; private set; }

    public void TryEnrollIn(Course course) {
        foreach (var c in Courses) {
            if (c.OverlapsWith(course)) throw ...
        }
    }

    public void EnrollIn(Course course) {
        this.Courses.Add(course);
    }
}
Pattern # 3: Capture Concepts
  We‘re missing an explicit concept:
  A Student has a Schedule
  The Schedule consists of Enrollments
  Constraint: Enrollments may not overlap
  Constraint: A Schedule may contain up to 5
  Enrollments
public class Course
{
    public int MaximumNumberOfStudents { get; private set; }
    public void Students { get; private set; }

    private void TryEnroll(Student student) {
        if (Students.Count() >= MaximumNumberOfStudents) throw ...
    }

    internal void Enroll(Student student) {
        // this.TryEnroll(student);
        // student.TryEnroll(this);
        this.Students.Add(student);
        // student.EnrollIn(this);
    }
}

public class Student
{
    public List<Course> Courses { get; private set; }
    public Schedule Schedule { get; private set; }

    public void EnrollIn(Course course) {
        var enrollment = course.CreateEnrollment(course);
        Schedule.TryAddEnrollment(enrollment);
        course.TryEnroll(this);
        Schedule.AddEnrollment(enrollment);
        course.Enroll(this);
    }
}
public class Course
{
    public int MaximumNumberOfStudents { get; private set; }
    // public void Students { get; private set; }
    public int NumberOfStudents { get; private set; }

    private void TryEnroll(Student student) {
        // if (Students.Count() >= MaximumNumberOfStudents) throw ...
        if (NumberOfStudents >= MaximumNumberOfStudents) throw ...
    }

    internal void Enroll(Student student) {
        this.NumberOfStudents++;
    }
}

public class Student
{
    public List<Course> Courses { get; private set; }
    public Schedule Schedule { get; private set; }

    public void EnrollIn(Course course) {
        var enrollment = course.CreateEnrollment(course);
        Schedule.TryAddEnrollment(enrollment);
        course.TryEnroll(this);
        Schedule.AddEnrollment(enrollment);
        course.Enroll(this);
    }
}
Aggregate
  A cluster of associated objects that are treated as a
  unit for the purpose of data changes.

  A set of consistency rules applies within the
  Aggregate‘s boundaries.
In other words:
  A Transaction should only affect one Aggregate.
What if ...
   ... they don‘t need to be done in one Transaction?

   ... we TryEnroll() but not Enroll()?
How big is the business impact?
Domain Events
  A Domain Event is a full-fledged part of the Domain
  Model, a representation of something that happened
  in the Domain.

  Something happened that Domain Experts care
  about, e.g. a Student enrolled in a Course.
public class Course
{
    public int MaximumNumberOfStudents { get; private set; }
    public int NumberOfStudents { get; private set; }

    private void TryEnroll(Student student) {
        if (NumberOfStudents >= MaximumNumberOfStudents) throw ...
    }

    /* public void Enroll(Student student) {
         this.NumberOfStudents++;
    } */

    public void Handle(StudentEnrolledInCourse event) {
        this.NumberOfStudents++;
    }
}

public class Student
{
    public List<Course> Courses { get; private set; }
    public Schedule Schedule { get; private set; }

    public void EnrollIn(Course course) {
        var enrollment = course.CreateEnrollment(course);
        Schedule.TryAddEnrollment(enrollment);
        course.TryEnroll(this);
        Schedule.AddEnrollment(enrollment);
        // course.Enroll(this);
        Bus.Publish(new StudentEnrolledInCourse( ... ));
    }
}
But, once again, what if ...
   ... the Student drops out of a Course?
New Use Case.
Ask the Domain Expert
1. don‘t be stupid

2. denormalize

3. break up consistencies
References & Further Reading:
  Inspiration for the exercises: The works of Greg Young

  Domain-Driven Design – Tackling Complexity in the Heart of Software,
  by Eric Evans, Addison-Wesley, 2004
  Implementing Domain-Driven Design by Vaughn Vernon, Addison-Wesley, 2012
  http://domaindrivendesign.org - DDD-Forum maintained by Eric Evans, et al.
  Effective Aggregate Design: bit.ly/ncCOTH
  Google Group: groups.google.com/forum/?fromgroups#!forum/dddcqrs
Dennis Traub

  @dtraub

 #devspace

Más contenido relacionado

La actualidad más candente

Introdução ao MongoDB em 30 slides
Introdução ao MongoDB em 30 slidesIntrodução ao MongoDB em 30 slides
Introdução ao MongoDB em 30 slidesDerek Willian Stavis
 
Solr vs. Elasticsearch - Case by Case
Solr vs. Elasticsearch - Case by CaseSolr vs. Elasticsearch - Case by Case
Solr vs. Elasticsearch - Case by CaseAlexandre Rafalovitch
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBNodeXperts
 
ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web APIhabib_786
 
Spark + Cassandra = Real Time Analytics on Operational Data
Spark + Cassandra = Real Time Analytics on Operational DataSpark + Cassandra = Real Time Analytics on Operational Data
Spark + Cassandra = Real Time Analytics on Operational DataVictor Coustenoble
 
Introduction to Mongodb execution plan and optimizer
Introduction to Mongodb execution plan and optimizerIntroduction to Mongodb execution plan and optimizer
Introduction to Mongodb execution plan and optimizerMydbops
 
Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017
Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017
Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017Amazon Web Services
 
PostgreSQL_ Up and Running_ A Practical Guide to the Advanced Open Source Dat...
PostgreSQL_ Up and Running_ A Practical Guide to the Advanced Open Source Dat...PostgreSQL_ Up and Running_ A Practical Guide to the Advanced Open Source Dat...
PostgreSQL_ Up and Running_ A Practical Guide to the Advanced Open Source Dat...MinhLeNguyenAnh2
 
Content Management with MongoDB by Mark Helmstetter
 Content Management with MongoDB by Mark Helmstetter Content Management with MongoDB by Mark Helmstetter
Content Management with MongoDB by Mark HelmstetterMongoDB
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to DjangoKnoldus Inc.
 
Introduction to Sharding
Introduction to ShardingIntroduction to Sharding
Introduction to ShardingMongoDB
 
MongoDB presentation
MongoDB presentationMongoDB presentation
MongoDB presentationHyphen Call
 
Criação de log de ações através do banco - PostgreSQL
Criação de log de ações através do banco - PostgreSQLCriação de log de ações através do banco - PostgreSQL
Criação de log de ações através do banco - PostgreSQLMarcos Thomaz
 
PostgreSQL Tutorial For Beginners | Edureka
PostgreSQL Tutorial For Beginners | EdurekaPostgreSQL Tutorial For Beginners | Edureka
PostgreSQL Tutorial For Beginners | EdurekaEdureka!
 

La actualidad más candente (20)

MongoDB
MongoDBMongoDB
MongoDB
 
Introdução ao MongoDB em 30 slides
Introdução ao MongoDB em 30 slidesIntrodução ao MongoDB em 30 slides
Introdução ao MongoDB em 30 slides
 
Oracle SQL Basics
Oracle SQL BasicsOracle SQL Basics
Oracle SQL Basics
 
PostgreSQL
PostgreSQLPostgreSQL
PostgreSQL
 
Solr vs. Elasticsearch - Case by Case
Solr vs. Elasticsearch - Case by CaseSolr vs. Elasticsearch - Case by Case
Solr vs. Elasticsearch - Case by Case
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web API
 
Spark + Cassandra = Real Time Analytics on Operational Data
Spark + Cassandra = Real Time Analytics on Operational DataSpark + Cassandra = Real Time Analytics on Operational Data
Spark + Cassandra = Real Time Analytics on Operational Data
 
Introduction to Mongodb execution plan and optimizer
Introduction to Mongodb execution plan and optimizerIntroduction to Mongodb execution plan and optimizer
Introduction to Mongodb execution plan and optimizer
 
Mongo DB
Mongo DBMongo DB
Mongo DB
 
Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017
Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017
Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017
 
PythonOOP
PythonOOPPythonOOP
PythonOOP
 
PostgreSQL_ Up and Running_ A Practical Guide to the Advanced Open Source Dat...
PostgreSQL_ Up and Running_ A Practical Guide to the Advanced Open Source Dat...PostgreSQL_ Up and Running_ A Practical Guide to the Advanced Open Source Dat...
PostgreSQL_ Up and Running_ A Practical Guide to the Advanced Open Source Dat...
 
Content Management with MongoDB by Mark Helmstetter
 Content Management with MongoDB by Mark Helmstetter Content Management with MongoDB by Mark Helmstetter
Content Management with MongoDB by Mark Helmstetter
 
Mongo db intro.pptx
Mongo db intro.pptxMongo db intro.pptx
Mongo db intro.pptx
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
 
Introduction to Sharding
Introduction to ShardingIntroduction to Sharding
Introduction to Sharding
 
MongoDB presentation
MongoDB presentationMongoDB presentation
MongoDB presentation
 
Criação de log de ações através do banco - PostgreSQL
Criação de log de ações através do banco - PostgreSQLCriação de log de ações através do banco - PostgreSQL
Criação de log de ações através do banco - PostgreSQL
 
PostgreSQL Tutorial For Beginners | Edureka
PostgreSQL Tutorial For Beginners | EdurekaPostgreSQL Tutorial For Beginners | Edureka
PostgreSQL Tutorial For Beginners | Edureka
 

Similar a DDD Modeling Workshop

Starting with Main.java, where I tested everythingimport College..pdf
Starting with Main.java, where I tested everythingimport College..pdfStarting with Main.java, where I tested everythingimport College..pdf
Starting with Main.java, where I tested everythingimport College..pdfaptind
 
import school.; import school.courses.;public class Main { p.pdf
import school.; import school.courses.;public class Main { p.pdfimport school.; import school.courses.;public class Main { p.pdf
import school.; import school.courses.;public class Main { p.pdfannaiwatertreatment
 
C# Delegates, Events, Lambda
C# Delegates, Events, LambdaC# Delegates, Events, Lambda
C# Delegates, Events, LambdaJussi Pohjolainen
 
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo....NET Conf UY
 
Assignment 7
Assignment 7Assignment 7
Assignment 7IIUM
 
C# Summer course - Lecture 4
C# Summer course - Lecture 4C# Summer course - Lecture 4
C# Summer course - Lecture 4mohamedsamyali
 
Refactoring - Mejorando el diseño del código existente
Refactoring - Mejorando el diseño del código existenteRefactoring - Mejorando el diseño del código existente
Refactoring - Mejorando el diseño del código existenteMariano Sánchez
 
A457405934_21789_26_2018_Inheritance.ppt
A457405934_21789_26_2018_Inheritance.pptA457405934_21789_26_2018_Inheritance.ppt
A457405934_21789_26_2018_Inheritance.pptRithwikRanjan
 
Cs141 mid termexam2_fall2017_v1.1_solution
Cs141 mid termexam2_fall2017_v1.1_solutionCs141 mid termexam2_fall2017_v1.1_solution
Cs141 mid termexam2_fall2017_v1.1_solutionFahadaio
 
Inheritance, polymorphisam, abstract classes and composition)
Inheritance, polymorphisam, abstract classes and composition)Inheritance, polymorphisam, abstract classes and composition)
Inheritance, polymorphisam, abstract classes and composition)farhan amjad
 
classes & objects.ppt
classes & objects.pptclasses & objects.ppt
classes & objects.pptBArulmozhi
 
[PL] O klasycznej, programistycznej elegancji
[PL] O klasycznej, programistycznej elegancji[PL] O klasycznej, programistycznej elegancji
[PL] O klasycznej, programistycznej elegancjiJakub Marchwicki
 
Hello. Im currently working on the last section to my assignment a.pdf
Hello. Im currently working on the last section to my assignment a.pdfHello. Im currently working on the last section to my assignment a.pdf
Hello. Im currently working on the last section to my assignment a.pdfirshadkumar3
 
Effective java-3rd-edition-ch4
Effective java-3rd-edition-ch4Effective java-3rd-edition-ch4
Effective java-3rd-edition-ch4Matt
 

Similar a DDD Modeling Workshop (20)

Starting with Main.java, where I tested everythingimport College..pdf
Starting with Main.java, where I tested everythingimport College..pdfStarting with Main.java, where I tested everythingimport College..pdf
Starting with Main.java, where I tested everythingimport College..pdf
 
import school.; import school.courses.;public class Main { p.pdf
import school.; import school.courses.;public class Main { p.pdfimport school.; import school.courses.;public class Main { p.pdf
import school.; import school.courses.;public class Main { p.pdf
 
C# Delegates, Events, Lambda
C# Delegates, Events, LambdaC# Delegates, Events, Lambda
C# Delegates, Events, Lambda
 
Mapeamento uml java
Mapeamento uml javaMapeamento uml java
Mapeamento uml java
 
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
 
Jar chapter 5_part_i
Jar chapter 5_part_iJar chapter 5_part_i
Jar chapter 5_part_i
 
Assignment 7
Assignment 7Assignment 7
Assignment 7
 
C# Summer course - Lecture 4
C# Summer course - Lecture 4C# Summer course - Lecture 4
C# Summer course - Lecture 4
 
6 class design
6 class design6 class design
6 class design
 
Refactoring - Mejorando el diseño del código existente
Refactoring - Mejorando el diseño del código existenteRefactoring - Mejorando el diseño del código existente
Refactoring - Mejorando el diseño del código existente
 
A457405934_21789_26_2018_Inheritance.ppt
A457405934_21789_26_2018_Inheritance.pptA457405934_21789_26_2018_Inheritance.ppt
A457405934_21789_26_2018_Inheritance.ppt
 
Cs141 mid termexam2_fall2017_v1.1_solution
Cs141 mid termexam2_fall2017_v1.1_solutionCs141 mid termexam2_fall2017_v1.1_solution
Cs141 mid termexam2_fall2017_v1.1_solution
 
Core java oop
Core java oopCore java oop
Core java oop
 
Inheritance, polymorphisam, abstract classes and composition)
Inheritance, polymorphisam, abstract classes and composition)Inheritance, polymorphisam, abstract classes and composition)
Inheritance, polymorphisam, abstract classes and composition)
 
Lecture 4 part 1.pdf
Lecture 4 part 1.pdfLecture 4 part 1.pdf
Lecture 4 part 1.pdf
 
classes & objects.ppt
classes & objects.pptclasses & objects.ppt
classes & objects.ppt
 
[PL] O klasycznej, programistycznej elegancji
[PL] O klasycznej, programistycznej elegancji[PL] O klasycznej, programistycznej elegancji
[PL] O klasycznej, programistycznej elegancji
 
Hello. Im currently working on the last section to my assignment a.pdf
Hello. Im currently working on the last section to my assignment a.pdfHello. Im currently working on the last section to my assignment a.pdf
Hello. Im currently working on the last section to my assignment a.pdf
 
Object oriented concepts
Object oriented conceptsObject oriented concepts
Object oriented concepts
 
Effective java-3rd-edition-ch4
Effective java-3rd-edition-ch4Effective java-3rd-edition-ch4
Effective java-3rd-edition-ch4
 

Más de Dennis Traub

Application Integration Patterns (not only) for Microservices
Application Integration Patterns (not only) for MicroservicesApplication Integration Patterns (not only) for Microservices
Application Integration Patterns (not only) for MicroservicesDennis Traub
 
Serverless SecOps Automation on AWS at AWS UG Krakow, Poland
Serverless SecOps Automation on AWS at AWS UG Krakow, PolandServerless SecOps Automation on AWS at AWS UG Krakow, Poland
Serverless SecOps Automation on AWS at AWS UG Krakow, PolandDennis Traub
 
Serverless Security Automation on AWS - Hamburg AWS User Group
Serverless Security Automation on AWS - Hamburg AWS User GroupServerless Security Automation on AWS - Hamburg AWS User Group
Serverless Security Automation on AWS - Hamburg AWS User GroupDennis Traub
 
Cloud ist keine Strategie - Keynote des AWS Cloud Day, Solingen
Cloud ist keine Strategie - Keynote des AWS Cloud Day, SolingenCloud ist keine Strategie - Keynote des AWS Cloud Day, Solingen
Cloud ist keine Strategie - Keynote des AWS Cloud Day, SolingenDennis Traub
 
Cloud ist keine Strategie - AWS Tech Community Summit Cologne, 2017
Cloud ist keine Strategie - AWS Tech Community Summit Cologne, 2017Cloud ist keine Strategie - AWS Tech Community Summit Cologne, 2017
Cloud ist keine Strategie - AWS Tech Community Summit Cologne, 2017Dennis Traub
 
Taming the Monolith - Microservices Meetup Hamburg
Taming the Monolith - Microservices Meetup HamburgTaming the Monolith - Microservices Meetup Hamburg
Taming the Monolith - Microservices Meetup HamburgDennis Traub
 
Taming the Monolith
Taming the MonolithTaming the Monolith
Taming the MonolithDennis Traub
 
DDD / Microservices @ Trivento Spring Camp, Utrecht, 2015
DDD / Microservices @ Trivento Spring Camp, Utrecht, 2015DDD / Microservices @ Trivento Spring Camp, Utrecht, 2015
DDD / Microservices @ Trivento Spring Camp, Utrecht, 2015Dennis Traub
 
Strategic Appplication Development with Domain-Driven Design (DDD)
Strategic Appplication Development with Domain-Driven Design (DDD)Strategic Appplication Development with Domain-Driven Design (DDD)
Strategic Appplication Development with Domain-Driven Design (DDD)Dennis Traub
 
An Introduction to CQRS
An Introduction to CQRSAn Introduction to CQRS
An Introduction to CQRSDennis Traub
 
Strategischer Anwendungsentwurf mit Domain-Driven Design
Strategischer Anwendungsentwurf mit Domain-Driven DesignStrategischer Anwendungsentwurf mit Domain-Driven Design
Strategischer Anwendungsentwurf mit Domain-Driven DesignDennis Traub
 
CQRS-Einführung - Teil 2
CQRS-Einführung - Teil 2CQRS-Einführung - Teil 2
CQRS-Einführung - Teil 2Dennis Traub
 
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011Dennis Traub
 

Más de Dennis Traub (14)

Application Integration Patterns (not only) for Microservices
Application Integration Patterns (not only) for MicroservicesApplication Integration Patterns (not only) for Microservices
Application Integration Patterns (not only) for Microservices
 
Serverless SecOps Automation on AWS at AWS UG Krakow, Poland
Serverless SecOps Automation on AWS at AWS UG Krakow, PolandServerless SecOps Automation on AWS at AWS UG Krakow, Poland
Serverless SecOps Automation on AWS at AWS UG Krakow, Poland
 
Serverless Security Automation on AWS - Hamburg AWS User Group
Serverless Security Automation on AWS - Hamburg AWS User GroupServerless Security Automation on AWS - Hamburg AWS User Group
Serverless Security Automation on AWS - Hamburg AWS User Group
 
Cloud ist keine Strategie - Keynote des AWS Cloud Day, Solingen
Cloud ist keine Strategie - Keynote des AWS Cloud Day, SolingenCloud ist keine Strategie - Keynote des AWS Cloud Day, Solingen
Cloud ist keine Strategie - Keynote des AWS Cloud Day, Solingen
 
Cloud ist keine Strategie - AWS Tech Community Summit Cologne, 2017
Cloud ist keine Strategie - AWS Tech Community Summit Cologne, 2017Cloud ist keine Strategie - AWS Tech Community Summit Cologne, 2017
Cloud ist keine Strategie - AWS Tech Community Summit Cologne, 2017
 
Taming the Monolith - Microservices Meetup Hamburg
Taming the Monolith - Microservices Meetup HamburgTaming the Monolith - Microservices Meetup Hamburg
Taming the Monolith - Microservices Meetup Hamburg
 
Taming the Monolith
Taming the MonolithTaming the Monolith
Taming the Monolith
 
DDD / Microservices @ Trivento Spring Camp, Utrecht, 2015
DDD / Microservices @ Trivento Spring Camp, Utrecht, 2015DDD / Microservices @ Trivento Spring Camp, Utrecht, 2015
DDD / Microservices @ Trivento Spring Camp, Utrecht, 2015
 
Strategic Appplication Development with Domain-Driven Design (DDD)
Strategic Appplication Development with Domain-Driven Design (DDD)Strategic Appplication Development with Domain-Driven Design (DDD)
Strategic Appplication Development with Domain-Driven Design (DDD)
 
An Introduction to CQRS
An Introduction to CQRSAn Introduction to CQRS
An Introduction to CQRS
 
From DDD to CQRS
From DDD to CQRSFrom DDD to CQRS
From DDD to CQRS
 
Strategischer Anwendungsentwurf mit Domain-Driven Design
Strategischer Anwendungsentwurf mit Domain-Driven DesignStrategischer Anwendungsentwurf mit Domain-Driven Design
Strategischer Anwendungsentwurf mit Domain-Driven Design
 
CQRS-Einführung - Teil 2
CQRS-Einführung - Teil 2CQRS-Einführung - Teil 2
CQRS-Einführung - Teil 2
 
CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011CQRS - Eine Einführung - NOUG 2011
CQRS - Eine Einführung - NOUG 2011
 

Último

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 

Último (20)

TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

DDD Modeling Workshop

  • 1. Domain-Driven Design Dennis Traub @dtraub #devspace 2012-10-19
  • 2. Domain A sphere of knowledge, influence, or activity. What an organization does and the world it does it in.
  • 3. Model A system of abstractions that describes selected aspects of a Domain and can be used to solve problems related to that Domain.
  • 5. we model useful abstractions of reality
  • 6. Ubiquitous Language A Language structured around the Domain Model and used by all team mebers.
  • 7. Bounded Context An explicit Boundary within which a Domain Model exists. Inside the boundary all terms have specific meaning. They are part of the context‘s Ubiquitous Language.
  • 8. BC Example: Online-Shop E-Commerce-System Inventory System Accounting
  • 9. Subdomains The whole Domain of the organization is comprised of Subdomains. They focus on only one specific area of the whole business Domain.
  • 10. Subdomain Example: Product Catalog Customer Management Orders Invoicing Inventory Shipping
  • 11. don‘t build a model that works for everyone
  • 12. Core Domain The distinctive part of the Model, central to the user‘s goals, that differentiates the application and makes it valuable. The most important Subdomain.
  • 13. Question # 1: Which subdomain creates the greatest competitive advantage?
  • 14. Question # 2: Which subdomain has the highest complexity?
  • 15. we don‘t use DDD when there‘s no value in formalizing the problem
  • 16. we only use DDD in parts where we get a competitive advantage
  • 17. Aggregate A cluster of associated objects that are treated as a unit for the purpose of data changes. A set of consistency rules applies within the Aggregate‘s boundaries.
  • 18. Exercise # 1: A simple Model We have Students, Courses, and Teachers A Student can take multiple Courses A Course can have multiple Students A Course is hosted by a Teacher A Teacher can host multiple Courses
  • 19. public class Teacher { public List<Course> Courses { get; private set; } } public class Course { public Teacher Teacher { get; private set; } public List<Student> Students { get; private set; } } public class Student { public List<Course> Courses { get; private set; } }
  • 20. Exercise # 2: Assign Teacher A Course ist hosted by a Teacher Constraint: A Teacher has a maximum number of students
  • 21. public class Teacher { public List<Course> Courses { get; private set; } public int MaximumNumberOfStudents { get; private set; } public void Assign(Course course) { if (course.Students.Count >= MaximumNumberOfStudents) throw ... this.Courses.Add(course); course.AssignTo(this); } } public class Course { public Teacher Teacher { get; private set; } public void AssignTo(Teacher teacher) { this.Teachers.Add(teacher); } }
  • 22. public class Teacher { public List<Course> Courses { get; private set; } public int MaximumNumberOfStudents { get; private set; } public void Assign(Course course) { if (course.Students.Count >= MaximumNumberOfStudents) throw ... this.Courses.Add(course); course.AssignTo(this); } } public class Course { public Teacher Teacher { get; private set; } public void AssignTo(Teacher teacher) { this.Teachers.Add(teacher); } }
  • 23. Pattern # 1: Responsibility We don‘t know where to put things. Responsibilities must be clear. Have one way of doing something, not many.
  • 24. public class Teacher { public List<Course> Courses { get; private set; } public int MaximumNumberOfStudents { get; private set; } public void Assign(Course course) { if (course.Students.Count >= MaximumNumberOfStudents) throw ... this.Courses.Add(course); // course.AssignTo(this); course.Teacher = this; } } public class Course { public Teacher Teacher { get; private set; } /* public void AssignTo(Teacher teacher) { this.Teachers.Add(teacher); } */ }
  • 25. public class Teacher { public List<Course> Courses { get; private set; } public int MaximumNumberOfStudents { get; private set; } public void Assign(Course course) { if (course.Students.Count >= MaximumNumberOfStudents) throw ... this.Courses.Add(course); // course.AssignTo(this); course.Teacher = this; } } public class Course { public Teacher Teacher { get; private set; } /* public void AssignTo(Teacher teacher) { this.Teachers.Add(teacher); } */ }
  • 26. Pattern # 2: Don‘t be stupid No rules on Teacher.Courses or Course.Teacher. We don‘t need the relationship.
  • 28. public class Teacher { public List<Course> Courses { get; private set; } public int MaximumNumberOfStudents { get; private set; } /* public void Assign(Course course) { if (course.Students.Count >= MaximumNumberOfStudents) throw ... this.Courses.Add(course); course.AssignTo(this); } */ } public class Course { // public Teacher Teacher { get; private set; } public int MaximumNumberOfStudents { get; private set; } public void AssignTo(Teacher teacher) { if (Students.Count >= teacher.MaximumNumberOfStudents) throw ... MaximumNumberOfStudents = teacher.MaximumNumberOfStudents; } }
  • 29. But what if ... What happens if the Teacher changes his/her maximum number of students?
  • 30. New Use Case. Ask the Domain Expert
  • 31. Exercise # 3: Enroll Student A Student can enroll in a Course Constraint: A Student can only enroll in up to five Courses Constraint: A Student‘s Courses may not overlap
  • 32. public class Course { public int MaximumNumberOfStudents { get; private set; } public void Students { get; private set; } private void TryEnroll(Student student) { if (Students.Count() >= MaximumNumberOfStudents) throw ... } public void Enroll(Student student) { this.TryEnroll(student); student.TryEnroll(this); this.Students.Add(student); student.EnrollIn(this); } } public class Student { public List<Course> Courses { get; private set; } public void TryEnrollIn(Course course) { foreach (var c in Courses) { if (c.OverlapsWith(course)) throw ... } } public void EnrollIn(Course course) { this.Courses.Add(course); } }
  • 33. public class Course { public int MaximumNumberOfStudents { get; private set; } public void Students { get; private set; } private void TryEnroll(Student student) { if (Students.Count() >= MaximumNumberOfStudents) throw ... } public void Enroll(Student student) { this.TryEnroll(student); student.TryEnroll(this); this.Students.Add(student); student.EnrollIn(this); } } public class Student { public List<Course> Courses { get; private set; } public void TryEnrollIn(Course course) { foreach (var c in Courses) { if (c.OverlapsWith(course)) throw ... } } public void EnrollIn(Course course) { this.Courses.Add(course); } }
  • 34. Pattern # 3: Capture Concepts We‘re missing an explicit concept: A Student has a Schedule The Schedule consists of Enrollments Constraint: Enrollments may not overlap Constraint: A Schedule may contain up to 5 Enrollments
  • 35. public class Course { public int MaximumNumberOfStudents { get; private set; } public void Students { get; private set; } private void TryEnroll(Student student) { if (Students.Count() >= MaximumNumberOfStudents) throw ... } internal void Enroll(Student student) { // this.TryEnroll(student); // student.TryEnroll(this); this.Students.Add(student); // student.EnrollIn(this); } } public class Student { public List<Course> Courses { get; private set; } public Schedule Schedule { get; private set; } public void EnrollIn(Course course) { var enrollment = course.CreateEnrollment(course); Schedule.TryAddEnrollment(enrollment); course.TryEnroll(this); Schedule.AddEnrollment(enrollment); course.Enroll(this); } }
  • 36. public class Course { public int MaximumNumberOfStudents { get; private set; } // public void Students { get; private set; } public int NumberOfStudents { get; private set; } private void TryEnroll(Student student) { // if (Students.Count() >= MaximumNumberOfStudents) throw ... if (NumberOfStudents >= MaximumNumberOfStudents) throw ... } internal void Enroll(Student student) { this.NumberOfStudents++; } } public class Student { public List<Course> Courses { get; private set; } public Schedule Schedule { get; private set; } public void EnrollIn(Course course) { var enrollment = course.CreateEnrollment(course); Schedule.TryAddEnrollment(enrollment); course.TryEnroll(this); Schedule.AddEnrollment(enrollment); course.Enroll(this); } }
  • 37. Aggregate A cluster of associated objects that are treated as a unit for the purpose of data changes. A set of consistency rules applies within the Aggregate‘s boundaries.
  • 38. In other words: A Transaction should only affect one Aggregate.
  • 39. What if ... ... they don‘t need to be done in one Transaction? ... we TryEnroll() but not Enroll()?
  • 40. How big is the business impact?
  • 41. Domain Events A Domain Event is a full-fledged part of the Domain Model, a representation of something that happened in the Domain. Something happened that Domain Experts care about, e.g. a Student enrolled in a Course.
  • 42. public class Course { public int MaximumNumberOfStudents { get; private set; } public int NumberOfStudents { get; private set; } private void TryEnroll(Student student) { if (NumberOfStudents >= MaximumNumberOfStudents) throw ... } /* public void Enroll(Student student) { this.NumberOfStudents++; } */ public void Handle(StudentEnrolledInCourse event) { this.NumberOfStudents++; } } public class Student { public List<Course> Courses { get; private set; } public Schedule Schedule { get; private set; } public void EnrollIn(Course course) { var enrollment = course.CreateEnrollment(course); Schedule.TryAddEnrollment(enrollment); course.TryEnroll(this); Schedule.AddEnrollment(enrollment); // course.Enroll(this); Bus.Publish(new StudentEnrolledInCourse( ... )); } }
  • 43. But, once again, what if ... ... the Student drops out of a Course?
  • 44. New Use Case. Ask the Domain Expert
  • 45. 1. don‘t be stupid 2. denormalize 3. break up consistencies
  • 46. References & Further Reading: Inspiration for the exercises: The works of Greg Young Domain-Driven Design – Tackling Complexity in the Heart of Software, by Eric Evans, Addison-Wesley, 2004 Implementing Domain-Driven Design by Vaughn Vernon, Addison-Wesley, 2012 http://domaindrivendesign.org - DDD-Forum maintained by Eric Evans, et al. Effective Aggregate Design: bit.ly/ncCOTH Google Group: groups.google.com/forum/?fromgroups#!forum/dddcqrs
  • 47. Dennis Traub @dtraub #devspace