SlideShare a Scribd company logo
1 of 27
Download to read offline
Rebuilding Legacy Apps
with Domain-Driven Design1
1
Lessons learned
Kacper Gunia
• Independent consultant at Domain Centric
• Helping companies to be successful with DDD
• @cakper / kacper@gunia.me
It’s important to remember that when you start from scratch there
is absolutely no reason to believe that you are going to do a
better job than you did the first time.
— Joel Spolsky
Not all of a large system will be well designed
— Eric Evans
Legacy strategies by Eric Evans
1. Bubble Context
2. Autonomous Bubble
3. Exposing Legacy assets as services
4. Event Streams
$ SET SOURCEFORMAT"FREE"
IDENTIFICATION DIVISION.
PROGRAM-ID. Iteration-If.
AUTHOR. Michael Coughlan.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 Num1 PIC 9 VALUE ZEROS.
01 Num2 PIC 9 VALUE ZEROS.
01 Result PIC 99 VALUE ZEROS.
01 Operator PIC X VALUE SPACE.
PROCEDURE DIVISION.
Calculator.
PERFORM 3 TIMES
DISPLAY "Enter First Number : " WITH NO ADVANCING
ACCEPT Num1
DISPLAY "Enter Second Number : " WITH NO ADVANCING
ACCEPT Num2
DISPLAY "Enter operator (+ or *) : " WITH NO ADVANCING
ACCEPT Operator
IF Operator = "+" THEN
ADD Num1, Num2 GIVING Result
END-IF
IF Operator = "*" THEN
MULTIPLY Num1 BY Num2 GIVING Result
END-IF
DISPLAY "Result is = ", Result
END-PERFORM.
STOP RUN.
Reasons to rebuild
• Lack of expertise
• Cost of maintenance is greater than
cost of rebuild + maintenance
• Change to a single component cascades through the
system
• Replacing off-the-shelf solution
Lessons Learned
Lesson 1:
Context Map
is your friend
Understand the big picture
• Non trivial systems never live in isolation
• Look for relationships and understand them well
• Find boundaries
• Look at cost of breaking / maintaining the relationship
• Make sure you understand the scope well
Integration groundwork
• Improve / change relationships that might be hard to maintain
• Do not rebuild and change interfaces at the same time
• Hedge contexts with Anti-Corruption Layers
• Work out non-functional requirements
• Make use of existing tests suites / write new
• Automate parallel validation
• Track progress
Lesson 2:
Follow the
Walking Skeleton
Be smart about the scope
• Avoid "Death by user stories" / feature shopping list
• Agree what the MVP / Walking Skeleton is and focus on it
• Goal is to prove that the team is able to deliver
• Show value to the business
• Call out unrealistic requirements
Impact Mapping2
2
https://www.impactmapping.org/
Lesson 3:
Do not ignore
Legacy Design
Design
• Make sure to have right people in the room
• Include Domain Experts, Legacy Developers, Business
• Make sure you understand well why rewrite is happening
• Focus on "what" not "how"
• Explore options / deliberate discovery 3
3
https://lizkeogh.com/2012/09/21/the-deliberate-discovery-workshop/
Design
• "Ubiquitous language" of legacy
• Language needs to evolve
• It's impossible to design a system without considering
technology
• Ensure good facilitation
Lesson 4:
Bounded Contexts
are not Microservices
Microservices
• Consistency as a driver
• Aggregates define consistency boundaries
• Consistency is defined by business, not developers!
• Where are good, old modules/packages
• Ports as deployable components
Lesson 5:
Event Sourcing:
beauty is only skin deep
Event Sourcing
• Sometimes make a lot of sense
• ES based model allowed us to simplify some complex
processes
• Projections make integration easy
• Start with really specific and reach events
• Separate aggregate state from apply and from handle
• Testing is explicit
Event Sourcing
• Lack of expertise / lesser known
• Event based integration
• Idempotency and delivery guarantees
• Eventual consistency
• Synchronous commands
• Migration of CRUD models
• Event stream housekeeping
Summary
• Find explicit boundaries of rewrite with Context Mapping
• Minimise number of changes at a time
• Use Walking Skeleton / MVP approach
• Learn from legacy designs but remember reasons for rebuild
• Base the design on Aggregate consistency
• Make sure you have good reason to use Event Sourcing
Thanks!
@cakper / kacper@gunia.me
References
• Domain-Driven Design: Tackling Complexity in the Heart of Software -
Eric Evans
• Getting started with DDD when surrounded by legacy systems - Eric
Evans
• Versioning in an Event Sourced System - Gregory Young
• Impact Mapping: Making a Big Impact with Software Products and
Projects - Gojko Adzic
• Graphic - own resource, Public Domain photos from pixabay.com, Impact
Mapping graphic from www.impactmapping.org

More Related Content

What's hot

Containers & Cloud Native Ops Cloud Foundry Approach
Containers & Cloud Native Ops Cloud Foundry ApproachContainers & Cloud Native Ops Cloud Foundry Approach
Containers & Cloud Native Ops Cloud Foundry ApproachCodeOps Technologies LLP
 
Containers and Developer Defined Data Centers - Evan Powell - Keynote in Bang...
Containers and Developer Defined Data Centers - Evan Powell - Keynote in Bang...Containers and Developer Defined Data Centers - Evan Powell - Keynote in Bang...
Containers and Developer Defined Data Centers - Evan Powell - Keynote in Bang...CodeOps Technologies LLP
 
Making it Easier to Contribute to Open Source Projects Using Docker Container...
Making it Easier to Contribute to Open Source Projects Using Docker Container...Making it Easier to Contribute to Open Source Projects Using Docker Container...
Making it Easier to Contribute to Open Source Projects Using Docker Container...Docker, Inc.
 
Containers and VMs and Clouds: Oh My. by Mike Coleman
Containers and VMs and Clouds: Oh My. by Mike ColemanContainers and VMs and Clouds: Oh My. by Mike Coleman
Containers and VMs and Clouds: Oh My. by Mike ColemanDocker, Inc.
 
ADDO 2020: "The past, present, and future of cloud native API gateways"
ADDO 2020: "The past, present, and future of cloud native API gateways"ADDO 2020: "The past, present, and future of cloud native API gateways"
ADDO 2020: "The past, present, and future of cloud native API gateways"Daniel Bryant
 
DockerCon SF 2015: Faster, Cheaper, Safer
DockerCon SF 2015: Faster, Cheaper, SaferDockerCon SF 2015: Faster, Cheaper, Safer
DockerCon SF 2015: Faster, Cheaper, SaferDocker, Inc.
 
Who needs containers in a serverless world
Who needs containers in a serverless worldWho needs containers in a serverless world
Who needs containers in a serverless worldMatthias Luebken
 
Application Deployment and Management at Scale with 1&1 by Matt Baldwin
Application Deployment and Management at Scale with 1&1 by Matt BaldwinApplication Deployment and Management at Scale with 1&1 by Matt Baldwin
Application Deployment and Management at Scale with 1&1 by Matt BaldwinDocker, Inc.
 
DCSF19 Container Security: Theory & Practice at Netflix
DCSF19 Container Security: Theory & Practice at NetflixDCSF19 Container Security: Theory & Practice at Netflix
DCSF19 Container Security: Theory & Practice at NetflixDocker, Inc.
 
Building a Platform-as-a-Service with Docker and Node.js
Building a Platform-as-a-Service with Docker and Node.jsBuilding a Platform-as-a-Service with Docker and Node.js
Building a Platform-as-a-Service with Docker and Node.jsKevin Swiber
 
GOTOpia 2020: "The Past, Present, and Future of Cloud Native API Gateways"
GOTOpia 2020: "The Past, Present, and Future of Cloud Native API Gateways"GOTOpia 2020: "The Past, Present, and Future of Cloud Native API Gateways"
GOTOpia 2020: "The Past, Present, and Future of Cloud Native API Gateways"Daniel Bryant
 
Sebastien goasguen cloud stack and docker
Sebastien goasguen   cloud stack and dockerSebastien goasguen   cloud stack and docker
Sebastien goasguen cloud stack and dockerShapeBlue
 
DCSF 19 Developing Apps with Containers, Functions and Cloud Services
DCSF 19 Developing Apps with Containers, Functions and Cloud ServicesDCSF 19 Developing Apps with Containers, Functions and Cloud Services
DCSF 19 Developing Apps with Containers, Functions and Cloud ServicesDocker, Inc.
 
Azure kubernetes service
Azure kubernetes serviceAzure kubernetes service
Azure kubernetes serviceVishwas N
 
Autoscaling Docker Containers by Konstantinos Faliagkas, Docker Birthday #3 A...
Autoscaling Docker Containers by Konstantinos Faliagkas, Docker Birthday #3 A...Autoscaling Docker Containers by Konstantinos Faliagkas, Docker Birthday #3 A...
Autoscaling Docker Containers by Konstantinos Faliagkas, Docker Birthday #3 A...Docker, Inc.
 
Proof of Concept: Serverless with Swarm by Nirmal Mehta, Booz Allen Hamilton
Proof of Concept: Serverless with Swarm by Nirmal Mehta, Booz Allen Hamilton Proof of Concept: Serverless with Swarm by Nirmal Mehta, Booz Allen Hamilton
Proof of Concept: Serverless with Swarm by Nirmal Mehta, Booz Allen Hamilton Docker, Inc.
 
Build your own private Cloud environment
Build your own private Cloud environmentBuild your own private Cloud environment
Build your own private Cloud environmentNico Meisenzahl
 
Building a SaaS with Nodejs, Docker, and CoreOS
Building a SaaS with Nodejs, Docker, and CoreOSBuilding a SaaS with Nodejs, Docker, and CoreOS
Building a SaaS with Nodejs, Docker, and CoreOSRoss Kukulinski
 

What's hot (20)

Containers & Cloud Native Ops Cloud Foundry Approach
Containers & Cloud Native Ops Cloud Foundry ApproachContainers & Cloud Native Ops Cloud Foundry Approach
Containers & Cloud Native Ops Cloud Foundry Approach
 
Containers and Developer Defined Data Centers - Evan Powell - Keynote in Bang...
Containers and Developer Defined Data Centers - Evan Powell - Keynote in Bang...Containers and Developer Defined Data Centers - Evan Powell - Keynote in Bang...
Containers and Developer Defined Data Centers - Evan Powell - Keynote in Bang...
 
Serverless
ServerlessServerless
Serverless
 
Making it Easier to Contribute to Open Source Projects Using Docker Container...
Making it Easier to Contribute to Open Source Projects Using Docker Container...Making it Easier to Contribute to Open Source Projects Using Docker Container...
Making it Easier to Contribute to Open Source Projects Using Docker Container...
 
Containers and VMs and Clouds: Oh My. by Mike Coleman
Containers and VMs and Clouds: Oh My. by Mike ColemanContainers and VMs and Clouds: Oh My. by Mike Coleman
Containers and VMs and Clouds: Oh My. by Mike Coleman
 
ADDO 2020: "The past, present, and future of cloud native API gateways"
ADDO 2020: "The past, present, and future of cloud native API gateways"ADDO 2020: "The past, present, and future of cloud native API gateways"
ADDO 2020: "The past, present, and future of cloud native API gateways"
 
DockerCon SF 2015: Faster, Cheaper, Safer
DockerCon SF 2015: Faster, Cheaper, SaferDockerCon SF 2015: Faster, Cheaper, Safer
DockerCon SF 2015: Faster, Cheaper, Safer
 
Who needs containers in a serverless world
Who needs containers in a serverless worldWho needs containers in a serverless world
Who needs containers in a serverless world
 
Application Deployment and Management at Scale with 1&1 by Matt Baldwin
Application Deployment and Management at Scale with 1&1 by Matt BaldwinApplication Deployment and Management at Scale with 1&1 by Matt Baldwin
Application Deployment and Management at Scale with 1&1 by Matt Baldwin
 
DCSF19 Container Security: Theory & Practice at Netflix
DCSF19 Container Security: Theory & Practice at NetflixDCSF19 Container Security: Theory & Practice at Netflix
DCSF19 Container Security: Theory & Practice at Netflix
 
Building a Platform-as-a-Service with Docker and Node.js
Building a Platform-as-a-Service with Docker and Node.jsBuilding a Platform-as-a-Service with Docker and Node.js
Building a Platform-as-a-Service with Docker and Node.js
 
Docker in Production at the Aurora Team
Docker in Production at the Aurora TeamDocker in Production at the Aurora Team
Docker in Production at the Aurora Team
 
GOTOpia 2020: "The Past, Present, and Future of Cloud Native API Gateways"
GOTOpia 2020: "The Past, Present, and Future of Cloud Native API Gateways"GOTOpia 2020: "The Past, Present, and Future of Cloud Native API Gateways"
GOTOpia 2020: "The Past, Present, and Future of Cloud Native API Gateways"
 
Sebastien goasguen cloud stack and docker
Sebastien goasguen   cloud stack and dockerSebastien goasguen   cloud stack and docker
Sebastien goasguen cloud stack and docker
 
DCSF 19 Developing Apps with Containers, Functions and Cloud Services
DCSF 19 Developing Apps with Containers, Functions and Cloud ServicesDCSF 19 Developing Apps with Containers, Functions and Cloud Services
DCSF 19 Developing Apps with Containers, Functions and Cloud Services
 
Azure kubernetes service
Azure kubernetes serviceAzure kubernetes service
Azure kubernetes service
 
Autoscaling Docker Containers by Konstantinos Faliagkas, Docker Birthday #3 A...
Autoscaling Docker Containers by Konstantinos Faliagkas, Docker Birthday #3 A...Autoscaling Docker Containers by Konstantinos Faliagkas, Docker Birthday #3 A...
Autoscaling Docker Containers by Konstantinos Faliagkas, Docker Birthday #3 A...
 
Proof of Concept: Serverless with Swarm by Nirmal Mehta, Booz Allen Hamilton
Proof of Concept: Serverless with Swarm by Nirmal Mehta, Booz Allen Hamilton Proof of Concept: Serverless with Swarm by Nirmal Mehta, Booz Allen Hamilton
Proof of Concept: Serverless with Swarm by Nirmal Mehta, Booz Allen Hamilton
 
Build your own private Cloud environment
Build your own private Cloud environmentBuild your own private Cloud environment
Build your own private Cloud environment
 
Building a SaaS with Nodejs, Docker, and CoreOS
Building a SaaS with Nodejs, Docker, and CoreOSBuilding a SaaS with Nodejs, Docker, and CoreOS
Building a SaaS with Nodejs, Docker, and CoreOS
 

Similar to Rebuilding Legacy Apps with Domain-Driven Design - Lessons learned

Cleaning Code - Tools and Techniques for Large Legacy Projects
Cleaning Code - Tools and Techniques for Large Legacy ProjectsCleaning Code - Tools and Techniques for Large Legacy Projects
Cleaning Code - Tools and Techniques for Large Legacy ProjectsMike Long
 
Lessons Learned From Cloud Migrations
Lessons Learned From Cloud MigrationsLessons Learned From Cloud Migrations
Lessons Learned From Cloud MigrationsMandi Walls
 
Project Sherpa: How RightScale Went All in on Docker
Project Sherpa: How RightScale Went All in on DockerProject Sherpa: How RightScale Went All in on Docker
Project Sherpa: How RightScale Went All in on DockerRightScale
 
Arch factory - Agile Design: Best Practices
Arch factory - Agile Design: Best PracticesArch factory - Agile Design: Best Practices
Arch factory - Agile Design: Best PracticesIgor Moochnick
 
14 Habits of Great SQL Developers
14 Habits of Great SQL Developers14 Habits of Great SQL Developers
14 Habits of Great SQL DevelopersIke Ellis
 
Twelve practices of XP_Se lect5 btech
Twelve practices of XP_Se lect5 btechTwelve practices of XP_Se lect5 btech
Twelve practices of XP_Se lect5 btechIIITA
 
Why We Need Architects (and Architecture) on Agile Projects
Why We Need Architects (and Architecture) on Agile ProjectsWhy We Need Architects (and Architecture) on Agile Projects
Why We Need Architects (and Architecture) on Agile ProjectsRebecca Wirfs-Brock
 
Final spiralmodel97
Final spiralmodel97Final spiralmodel97
Final spiralmodel97akshay8835
 
Patterns and Antipatterns for Adopting IBM DevOps Tools
Patterns and Antipatterns for Adopting IBM DevOps ToolsPatterns and Antipatterns for Adopting IBM DevOps Tools
Patterns and Antipatterns for Adopting IBM DevOps ToolsStrongback Consulting
 
Lessons Learned from Continuous Delivery
Lessons Learned from Continuous DeliveryLessons Learned from Continuous Delivery
Lessons Learned from Continuous DeliveryMandi Walls
 
Estimation Protips - NCDevCon 2014
Estimation Protips - NCDevCon 2014Estimation Protips - NCDevCon 2014
Estimation Protips - NCDevCon 2014Jonathon Hill
 
Technical stories v1.2
Technical stories v1.2Technical stories v1.2
Technical stories v1.2Jim Brisson
 
Clean code presentation
Clean code presentationClean code presentation
Clean code presentationBhavin Gandhi
 
DrupalCon Austin: Planning for Performance
DrupalCon Austin: Planning for PerformanceDrupalCon Austin: Planning for Performance
DrupalCon Austin: Planning for PerformanceJeff Beeman
 
UX in Action: IBM Watson
UX in Action: IBM WatsonUX in Action: IBM Watson
UX in Action: IBM WatsonUserTesting
 
A Proven Software Development Process for the Non Technical Founder
A Proven Software Development Process for the Non Technical FounderA Proven Software Development Process for the Non Technical Founder
A Proven Software Development Process for the Non Technical FounderFounders Workshop
 
Lessons learned from applying Event sourcing and CQRS
Lessons learned from applying Event sourcing and CQRSLessons learned from applying Event sourcing and CQRS
Lessons learned from applying Event sourcing and CQRSSavvas Kleanthous
 

Similar to Rebuilding Legacy Apps with Domain-Driven Design - Lessons learned (20)

Cleaning Code - Tools and Techniques for Large Legacy Projects
Cleaning Code - Tools and Techniques for Large Legacy ProjectsCleaning Code - Tools and Techniques for Large Legacy Projects
Cleaning Code - Tools and Techniques for Large Legacy Projects
 
Lessons Learned From Cloud Migrations
Lessons Learned From Cloud MigrationsLessons Learned From Cloud Migrations
Lessons Learned From Cloud Migrations
 
Get lean tutorial
Get lean tutorialGet lean tutorial
Get lean tutorial
 
Project Sherpa: How RightScale Went All in on Docker
Project Sherpa: How RightScale Went All in on DockerProject Sherpa: How RightScale Went All in on Docker
Project Sherpa: How RightScale Went All in on Docker
 
Arch factory - Agile Design: Best Practices
Arch factory - Agile Design: Best PracticesArch factory - Agile Design: Best Practices
Arch factory - Agile Design: Best Practices
 
14 Habits of Great SQL Developers
14 Habits of Great SQL Developers14 Habits of Great SQL Developers
14 Habits of Great SQL Developers
 
It's XP, Stupid
It's XP, StupidIt's XP, Stupid
It's XP, Stupid
 
Twelve practices of XP_Se lect5 btech
Twelve practices of XP_Se lect5 btechTwelve practices of XP_Se lect5 btech
Twelve practices of XP_Se lect5 btech
 
Why We Need Architects (and Architecture) on Agile Projects
Why We Need Architects (and Architecture) on Agile ProjectsWhy We Need Architects (and Architecture) on Agile Projects
Why We Need Architects (and Architecture) on Agile Projects
 
Estimation Protips
Estimation ProtipsEstimation Protips
Estimation Protips
 
Final spiralmodel97
Final spiralmodel97Final spiralmodel97
Final spiralmodel97
 
Patterns and Antipatterns for Adopting IBM DevOps Tools
Patterns and Antipatterns for Adopting IBM DevOps ToolsPatterns and Antipatterns for Adopting IBM DevOps Tools
Patterns and Antipatterns for Adopting IBM DevOps Tools
 
Lessons Learned from Continuous Delivery
Lessons Learned from Continuous DeliveryLessons Learned from Continuous Delivery
Lessons Learned from Continuous Delivery
 
Estimation Protips - NCDevCon 2014
Estimation Protips - NCDevCon 2014Estimation Protips - NCDevCon 2014
Estimation Protips - NCDevCon 2014
 
Technical stories v1.2
Technical stories v1.2Technical stories v1.2
Technical stories v1.2
 
Clean code presentation
Clean code presentationClean code presentation
Clean code presentation
 
DrupalCon Austin: Planning for Performance
DrupalCon Austin: Planning for PerformanceDrupalCon Austin: Planning for Performance
DrupalCon Austin: Planning for Performance
 
UX in Action: IBM Watson
UX in Action: IBM WatsonUX in Action: IBM Watson
UX in Action: IBM Watson
 
A Proven Software Development Process for the Non Technical Founder
A Proven Software Development Process for the Non Technical FounderA Proven Software Development Process for the Non Technical Founder
A Proven Software Development Process for the Non Technical Founder
 
Lessons learned from applying Event sourcing and CQRS
Lessons learned from applying Event sourcing and CQRSLessons learned from applying Event sourcing and CQRS
Lessons learned from applying Event sourcing and CQRS
 

More from Kacper Gunia

How a large corporation used Domain-Driven Design to replace a loyalty system
How a large corporation used Domain-Driven Design to replace a loyalty systemHow a large corporation used Domain-Driven Design to replace a loyalty system
How a large corporation used Domain-Driven Design to replace a loyalty systemKacper Gunia
 
The IoC Hydra - Dutch PHP Conference 2016
The IoC Hydra - Dutch PHP Conference 2016The IoC Hydra - Dutch PHP Conference 2016
The IoC Hydra - Dutch PHP Conference 2016Kacper Gunia
 
The top 10 things that any pro PHP developer should be doing
The top 10 things that any pro PHP developer should be doingThe top 10 things that any pro PHP developer should be doing
The top 10 things that any pro PHP developer should be doingKacper Gunia
 
Embrace Events and let CRUD die
Embrace Events and let CRUD dieEmbrace Events and let CRUD die
Embrace Events and let CRUD dieKacper Gunia
 
Forget about Index.php and build you applications around HTTP - PHPers Cracow
Forget about Index.php and build you applications around HTTP - PHPers CracowForget about Index.php and build you applications around HTTP - PHPers Cracow
Forget about Index.php and build you applications around HTTP - PHPers CracowKacper Gunia
 
Domain-driven Design in PHP and Symfony - Drupal Camp Wroclaw!
Domain-driven Design in PHP and Symfony - Drupal Camp Wroclaw!Domain-driven Design in PHP and Symfony - Drupal Camp Wroclaw!
Domain-driven Design in PHP and Symfony - Drupal Camp Wroclaw!Kacper Gunia
 
OmniFocus - the #1 ‘Getting Things Done’ tool
OmniFocus - the #1 ‘Getting Things Done’ toolOmniFocus - the #1 ‘Getting Things Done’ tool
OmniFocus - the #1 ‘Getting Things Done’ toolKacper Gunia
 
Scaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
Scaling Symfony2 apps with RabbitMQ - Symfony UK MeetupScaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
Scaling Symfony2 apps with RabbitMQ - Symfony UK MeetupKacper Gunia
 
Forget about index.php and build you applications around HTTP!
Forget about index.php and build you applications around HTTP!Forget about index.php and build you applications around HTTP!
Forget about index.php and build you applications around HTTP!Kacper Gunia
 
Dutch PHP Conference - PHPSpec 2 - The only Design Tool you need
Dutch PHP Conference - PHPSpec 2 - The only Design Tool you needDutch PHP Conference - PHPSpec 2 - The only Design Tool you need
Dutch PHP Conference - PHPSpec 2 - The only Design Tool you needKacper Gunia
 
PHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4DevelopersPHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4DevelopersKacper Gunia
 
November Camp - Spec BDD with PHPSpec 2
November Camp - Spec BDD with PHPSpec 2November Camp - Spec BDD with PHPSpec 2
November Camp - Spec BDD with PHPSpec 2Kacper Gunia
 
Dependency Injection in PHP
Dependency Injection in PHPDependency Injection in PHP
Dependency Injection in PHPKacper Gunia
 

More from Kacper Gunia (16)

How a large corporation used Domain-Driven Design to replace a loyalty system
How a large corporation used Domain-Driven Design to replace a loyalty systemHow a large corporation used Domain-Driven Design to replace a loyalty system
How a large corporation used Domain-Driven Design to replace a loyalty system
 
The IoC Hydra - Dutch PHP Conference 2016
The IoC Hydra - Dutch PHP Conference 2016The IoC Hydra - Dutch PHP Conference 2016
The IoC Hydra - Dutch PHP Conference 2016
 
The top 10 things that any pro PHP developer should be doing
The top 10 things that any pro PHP developer should be doingThe top 10 things that any pro PHP developer should be doing
The top 10 things that any pro PHP developer should be doing
 
Embrace Events and let CRUD die
Embrace Events and let CRUD dieEmbrace Events and let CRUD die
Embrace Events and let CRUD die
 
The IoC Hydra
The IoC HydraThe IoC Hydra
The IoC Hydra
 
Forget about Index.php and build you applications around HTTP - PHPers Cracow
Forget about Index.php and build you applications around HTTP - PHPers CracowForget about Index.php and build you applications around HTTP - PHPers Cracow
Forget about Index.php and build you applications around HTTP - PHPers Cracow
 
Domain-driven Design in PHP and Symfony - Drupal Camp Wroclaw!
Domain-driven Design in PHP and Symfony - Drupal Camp Wroclaw!Domain-driven Design in PHP and Symfony - Drupal Camp Wroclaw!
Domain-driven Design in PHP and Symfony - Drupal Camp Wroclaw!
 
OmniFocus - the #1 ‘Getting Things Done’ tool
OmniFocus - the #1 ‘Getting Things Done’ toolOmniFocus - the #1 ‘Getting Things Done’ tool
OmniFocus - the #1 ‘Getting Things Done’ tool
 
Scaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
Scaling Symfony2 apps with RabbitMQ - Symfony UK MeetupScaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
Scaling Symfony2 apps with RabbitMQ - Symfony UK Meetup
 
Forget about index.php and build you applications around HTTP!
Forget about index.php and build you applications around HTTP!Forget about index.php and build you applications around HTTP!
Forget about index.php and build you applications around HTTP!
 
Dutch PHP Conference - PHPSpec 2 - The only Design Tool you need
Dutch PHP Conference - PHPSpec 2 - The only Design Tool you needDutch PHP Conference - PHPSpec 2 - The only Design Tool you need
Dutch PHP Conference - PHPSpec 2 - The only Design Tool you need
 
PHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4DevelopersPHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4Developers
 
November Camp - Spec BDD with PHPSpec 2
November Camp - Spec BDD with PHPSpec 2November Camp - Spec BDD with PHPSpec 2
November Camp - Spec BDD with PHPSpec 2
 
Dependency Injection in PHP
Dependency Injection in PHPDependency Injection in PHP
Dependency Injection in PHP
 
Code Dojo
Code DojoCode Dojo
Code Dojo
 
SpecBDD in PHP
SpecBDD in PHPSpecBDD in PHP
SpecBDD in PHP
 

Recently uploaded

Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...Akihiro Suda
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfYashikaSharma391629
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 

Recently uploaded (20)

Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 

Rebuilding Legacy Apps with Domain-Driven Design - Lessons learned

  • 1. Rebuilding Legacy Apps with Domain-Driven Design1 1 Lessons learned
  • 2. Kacper Gunia • Independent consultant at Domain Centric • Helping companies to be successful with DDD • @cakper / kacper@gunia.me
  • 3. It’s important to remember that when you start from scratch there is absolutely no reason to believe that you are going to do a better job than you did the first time. — Joel Spolsky
  • 4. Not all of a large system will be well designed — Eric Evans
  • 5. Legacy strategies by Eric Evans 1. Bubble Context 2. Autonomous Bubble 3. Exposing Legacy assets as services 4. Event Streams
  • 6. $ SET SOURCEFORMAT"FREE" IDENTIFICATION DIVISION. PROGRAM-ID. Iteration-If. AUTHOR. Michael Coughlan. DATA DIVISION. WORKING-STORAGE SECTION. 01 Num1 PIC 9 VALUE ZEROS. 01 Num2 PIC 9 VALUE ZEROS. 01 Result PIC 99 VALUE ZEROS. 01 Operator PIC X VALUE SPACE. PROCEDURE DIVISION. Calculator. PERFORM 3 TIMES DISPLAY "Enter First Number : " WITH NO ADVANCING ACCEPT Num1 DISPLAY "Enter Second Number : " WITH NO ADVANCING ACCEPT Num2 DISPLAY "Enter operator (+ or *) : " WITH NO ADVANCING ACCEPT Operator IF Operator = "+" THEN ADD Num1, Num2 GIVING Result END-IF IF Operator = "*" THEN MULTIPLY Num1 BY Num2 GIVING Result END-IF DISPLAY "Result is = ", Result END-PERFORM. STOP RUN.
  • 7. Reasons to rebuild • Lack of expertise • Cost of maintenance is greater than cost of rebuild + maintenance • Change to a single component cascades through the system • Replacing off-the-shelf solution
  • 10.
  • 11. Understand the big picture • Non trivial systems never live in isolation • Look for relationships and understand them well • Find boundaries • Look at cost of breaking / maintaining the relationship • Make sure you understand the scope well
  • 12.
  • 13. Integration groundwork • Improve / change relationships that might be hard to maintain • Do not rebuild and change interfaces at the same time • Hedge contexts with Anti-Corruption Layers • Work out non-functional requirements • Make use of existing tests suites / write new • Automate parallel validation • Track progress
  • 15. Be smart about the scope • Avoid "Death by user stories" / feature shopping list • Agree what the MVP / Walking Skeleton is and focus on it • Goal is to prove that the team is able to deliver • Show value to the business • Call out unrealistic requirements
  • 17. Lesson 3: Do not ignore Legacy Design
  • 18. Design • Make sure to have right people in the room • Include Domain Experts, Legacy Developers, Business • Make sure you understand well why rewrite is happening • Focus on "what" not "how" • Explore options / deliberate discovery 3 3 https://lizkeogh.com/2012/09/21/the-deliberate-discovery-workshop/
  • 19. Design • "Ubiquitous language" of legacy • Language needs to evolve • It's impossible to design a system without considering technology • Ensure good facilitation
  • 20. Lesson 4: Bounded Contexts are not Microservices
  • 21. Microservices • Consistency as a driver • Aggregates define consistency boundaries • Consistency is defined by business, not developers! • Where are good, old modules/packages • Ports as deployable components
  • 22. Lesson 5: Event Sourcing: beauty is only skin deep
  • 23. Event Sourcing • Sometimes make a lot of sense • ES based model allowed us to simplify some complex processes • Projections make integration easy • Start with really specific and reach events • Separate aggregate state from apply and from handle • Testing is explicit
  • 24. Event Sourcing • Lack of expertise / lesser known • Event based integration • Idempotency and delivery guarantees • Eventual consistency • Synchronous commands • Migration of CRUD models • Event stream housekeeping
  • 25. Summary • Find explicit boundaries of rewrite with Context Mapping • Minimise number of changes at a time • Use Walking Skeleton / MVP approach • Learn from legacy designs but remember reasons for rebuild • Base the design on Aggregate consistency • Make sure you have good reason to use Event Sourcing
  • 27. References • Domain-Driven Design: Tackling Complexity in the Heart of Software - Eric Evans • Getting started with DDD when surrounded by legacy systems - Eric Evans • Versioning in an Event Sourced System - Gregory Young • Impact Mapping: Making a Big Impact with Software Products and Projects - Gojko Adzic • Graphic - own resource, Public Domain photos from pixabay.com, Impact Mapping graphic from www.impactmapping.org