DataMappers 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 prevent our code from abuse?
- Where to put queries, and how test them?
It’s time to look beyond the old Gang of Four design patterns. There are Value Objects, Entities and Aggregates at the core; Repositories for persistence; Specifications to accurately describe object selections; Encapsulated Operations to protect invariants; and Domain Services and Double Dispatch when we need to group behavior safely. These patterns help us evolve from structural data models, to rich behavioral models. They capture not just state and relationships, but true meaning. These patterns protect our models from being used incorrectly, and allow us to test the essence of our applications.
The presentation is a fast paced introduction to the patterns that will make your Domain Model expressive, unbreakable, and beautiful.
Update: Replaced the slides with the slightly better slides from FrOSCon 2013