Unbreakable Domain Models

Published on 09 June 2013 by @mathiasverraes

Slides

See the slides on Speakerdeck

Video

Watch the video on Youtube

Abstract

Data Mappers (like Doctrine2) help us a lot to persist data. Yet many projects are still struggling with tough questions: - Where to put business logic? - How to protect our code from abuse? - Where to put queries, and how test them?

Let’s look beyond the old Gang of Four design patterns, and take some clues from tactical Domain Driven Design. At the heart of our models, we can use Value Objects and Entities, with tightly defined consistency boundaries. Repositories abstract away the persistence. Encapsulated Operations helps us to protect invariants. And if we need to manage a lot of complexity, the Specification pattern helps us express business rules in the language of the business.

These patterns help us evolve from structural data models, to rich behavioral models. They capture not just state and relationships, but true meaning.

The presentation is a fast paced introduction to some patterns and ideas that will make your Domain Model expressive, unbreakable, and beautiful.

Learn More

Check out Elephant in the Room #002: The Heart and Soul of OOP for more info about Value Objects.

Follow @mathiasverraes on Twitter.



Upcoming

2016
Topic Event Type Location Date
DDDinPHP 1 day training @ Coosto workshop Eindhoven, NL Oct 28
DDDinPHP 1 day training workshop Leuven, BE Dec 16
2017
Topic Event Type Location Date
Modelling Heuristics Workshop @ Domain-Driven Design Europe workshop Amsterdam NL, BE Feb 1
Conference Domain-Driven Design Europe 2017 organiser Amsterdam NL, BE Jan 31 - Feb 3
Older entries...

Blog Atom

2016

2015

2014

2013

2012

2011

Creative Commons License This work by Mathias Verraes is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 License.