This talk was delivered at the PHPers meetup in Wroclaw, 10 August 2015.
I presented a set of techniques which help you transition from a legacy codebase to DDD. I focused more on the strategic DDD patterns like bounded contexts.
The main idea in such refactorings is to:
1. List all your (potential) bounded contexts
2. Decide which ones are deserving the DDD tactical patterns
3. Decide which ones can stay as CRUD
4. Communicate between the BCs via events
11. DDD-lite
• app service
• domain service
• load aggregate from the repo
• do sth cool
• may use some value objects
• may trigger some domain events
• save aggregate (repo)
15. as microservices
partially available
different persistence
data duplication
Context Map
HR Project Management Finances
Invoicing
CRUD
DDD-lite
external SaaS
Communication
developer
project
client
16. How to get there from
legacy?
BTW, There’s no such thing as the ultimate DDD codebase
22. Mutation testing
is the real test coverage!
http://blog.arkency.com/2015/04/why-i-want-to-introduce-mutation-testing-to-the-rails-event-store-gem/
http://blog.arkency.com/2015/06/how-good-are-your-ruby-tests-testing-your-tests-with-mutant/
24. Test units, not classes!
http://andrzejonsoftware.blogspot.com/2015/02/tdding-unit-not-class.html
http://andrzejonsoftware.blogspot.com/2014/04/tdd-and-rails-what-makes-good-unit.html
http://blog.arkency.com/2014/09/unit-tests-vs-class-tests/
25. Escape from the
framework ASAP
http://blog.arkency.com/2015/03/extract-a-service-object-in-any-framework/
Call application services from the framework