SlideShare a Scribd company logo
D R S T R A N G L E R 

& M R H Y P E
S T R A N G L E R PAT T E R N I N P R A C T I C E
Michał Kurzeja
CTO @ Accesto
TW: @michalKurzeja
michal@accesto.com
T H I S TA L K S I S A B O U T
• Where legacy comes from?
• Why it is worth to get rid of legacy…
• … and how to make it properly?
• How not to hurt yourself
• Examples
T H I S TA L K I S N O T A B O U T
• How to test
• How to refactor classes/methods
• Silver bullet step-by-step approach
Bad practices
„Mr Hype”
Good practices

„Dr Strangler”
L E G A C Y C O D E
Strangler Pattern in practice @PHPers Day 2019
L E G A C Y ! = I N H E R I T E D C O D E
E X P E C TAT I O N S
R E A L I T Y
Q U A L I T Y D E C R E A S E S I N T I M E
- L A C K O F T H E „ B O Y S C O U T ” R U L E
0
17,5
35
52,5
70
2010 2011 2012 2013
R E S U LT S ? I S S U E S :
• Complicated code
• Harder to write tests
• Difficult deployment
• Reluctance of developers
• Hard to develop
H O W T O C O N V I N C E B U S I N E S S
• Slower development
• competitors might be faster
• increased costs
• HR issues: harder recruitment, more people leaving
• Lots of bugs, angry customers
• It might explode at any time ;)
2 0 1 2 , K N I G H T C A P I TA L G R O U P
$460 mln loss in 45 minutes
W H AT C A N W E D O ?
R E W R I T E F R O M S C R AT C H
F R O M 9 0 % T O 0 %
O F M A R K E T S H A R E
D E C L I N E O F N E T S C A P E
L O S T I T T O I N T E R N E T E X P L O R E R !
K E E P O N G O I N G
R E FA C T O R ?
Strangler Pattern in practice @PHPers Day 2019
Rewrite from scratchKeep on going
Refactor STRANGLE!
FUN
RISK
S T R A N G L E R PAT T E R N
Strangler Pattern in practice @PHPers Day 2019
Strangler Pattern in practice @PHPers Day 2019
Strangler Pattern in practice @PHPers Day 2019
Strangler Pattern in practice @PHPers Day 2019
Strangler Pattern in practice @PHPers Day 2019
Strangler Pattern in practice @PHPers Day 2019
G AT E WAY / FA C A D E
G AT E WAY - B U I L D I T L E A N
server {

listen 80;

server_name domain.com;



location /profile {

proxy_pass http://10.0.3.10:80;

}



location /news {

proxy_pass http://10.0.3.10:80;

}



proxy_pass http://10.0.3.20:80;

}
G AT E WAY - P O S S I B L E S O L U T I O N S
• API - Open Source
• Kong
• API - Paid
• AWS API Gateway
• WWW
• HaProxy
• Nginx/Apache/…
S TA R T W I T H C AT C H A L L
Strangler Pattern in practice @PHPers Day 2019
S H A R E D D ATA B A S E
D I S T R I B U T E D S H I T
S P L I T D ATA B A S E S
• Scheduled sync (cron)
• Events (required change in legacy)
• DB Triggers
• Transaction log (Binlog -> Kafka)
A P I
Strangler Pattern in practice @PHPers Day 2019
B O U N D A R I E S
ANTI-CORRUPTION LAYER
A C L
Strangler Pattern in practice @PHPers Day 2019
Strangler Pattern in practice @PHPers Day 2019
Strangler Pattern in practice @PHPers Day 2019
Strangler Pattern in practice @PHPers Day 2019
Strangler Pattern in practice @PHPers Day 2019
Strangler Pattern in practice @PHPers Day 2019
L E G A C Y I N A B O X
Strangler Pattern in practice @PHPers Day 2019
Strangler Pattern in practice @PHPers Day 2019
I N P R A C T I C E
L O N G T I M E A G O …
• Market leader
• Project started in 2010, we took over in 2016
• Customers: banks, political parties - no downtime
allowed ;)
N O F R O N T- C O N T R O L L E R
„ C U T E ” V E R S I O N I N G
„ M A G I C ” S T R U C T U R E
„ B U L L E T P R O O F ” C O N F I G
It was $_SERVER[SERVER_NAME];
„ R E A D A B L E ” C O D E
Generally….
S E V E R A L G R AY H A I R L AT E R
• Monorepo
• Apache as facade
• Anti-Corruption Layer -> API
• JSON Web Token
• Configuration by env variables
Strangler Pattern in practice @PHPers Day 2019
• 100% automated deployment (on Kubernetes)
• Business is very happy
• Programmers are still alive (and work for us)
M I S TA K E S 

W H AT C O U L D B E D O N E B E T T E R
F E AT U R E T O G G L E
J W T F R O M D AY 1 0
B E T T E R A C L
I S S U E S
P R O S
• Small risk, less stress, quick releases
• Instant effects
• Both business and developers happy
S E C O N D A P P R O A C H - A C L *
* M O D I F I E D A B I T
M O D E R N A C L L E G A C Y
https://github.com/VaughnVernon/IDDD_Samples/tree/master/iddd_collaboration/src/main/java/com/saasovation/
collaboration/port/adapter/service
M O D E R N A C L L E G A C Y
APIREPO
class Currency
{
private $isoCode;
private $default;
private $ratio;
}
M O D E R N - C U R R E N C Y M O D E L
interface CurrencyRepository
{
public function findAll();
public function getDefault();
public function find(string $isoCode);
public function save(Currency $currency);
}
M O D E R N - C U R R E N C Y R E P O S I T O RY
class Internal_CurrencyController extends Internal_Controller_InternalController
{
public function listcurrenciesAction()
{
$this->checkIp();
$this->getResponse()->setHeader('Content-type', 'application/json');
$mCurrency = new Default_Model_Currency();
/** @var Zend_Db_Table_Rowset $currencies */
$currencies = $mCurrency->fetchAll('status = "active"');
$this->getResponse()
->setBody(json_encode($currencies->toArray()))
->setHttpResponseCode(200);
}
}
L E G A C Y - C U R R E N C Y FA C A D E
interface CurrencyAdapter
{
public function findAll(): array;
}
A C L - C U R R E N C Y A P I I N T E R FA C E
class LegacyCurrencyAdapter implements CurrencyAdapter
{
public function findAll(): array
{
$response = $this->client->request('GET', 'listCurrencies');
$currencies = json_decode((string) $response->getBody(), true);
return array_map(function ($row) {
$currency = $this->currencyTranslator->createFromArray($row);
if ($exCurrency = $this->currRepo->find($currency->isoCode())) {
$currency->setRatio($exCurrency->getRatio());
$currency->setDefault($exCurrency->getDefault());
}
return $currency;
}, $currencies);
}
}
A C L - C U R R E N C Y A P I
class LegacyCurrencyTranslator implements CurrencyTranslator
{
public function createFromArray(array $data)
{
$default = filter_var($data['default'], FILTER_VALIDATE_BOOLEAN);
$ratio = filter_var($data['value'], FILTER_VALIDATE_FLOAT);
return new Currency($data['code'], $ratio, $default);
}
}
A C L - C U R R E N C Y T R A N S L AT O R
W H AT N O T T O D O
R O U T I N G I N L E G A C Y / M O D E R N
L A C K O F A N T I - C O R R U P T I O N L AY E R
P L A N F I R S T,
C O D E L AT E R
Strangler Pattern in practice @PHPers Day 2019
GETTING STARTED WITH DDD WHEN SURROUNDED BY
LEGACY SYSTEMS
E R I C E VA N S
Strangler Pattern in practice @PHPers Day 2019
W R I T E S O F T WA R E T H AT
I S E A S Y T O S T R A N G L E
Michał Kurzeja
CTO @ Accesto
@michalKurzeja
michal@accesto.com
Thanks!
Ad

Recommended

PPTX
Dr Strangler and Mr Hype - Strangler pattern w praktyce
Michał Kurzeja
 
PDF
Meteor WWNRW Intro
Stephan Hochhaus
 
PDF
Designing your API Server for mobile apps
Mugunth Kumar
 
PDF
Fighting legacy with hexagonal architecture and frameworkless php
Fabio Pellegrini
 
PDF
Don't Fear the Walking Dead @ PHPUGHH
tech.kartenmacherei
 
PDF
Web Development for Managers
Randy Connolly
 
KEY
Social dev camp_2011
Craig Ulliott
 
PDF
Better Laziness Through Hypermedia -- Designing a Hypermedia Client
Pete Gamache
 
KEY
Modular Web Applications With Netzke
netzke
 
PPTX
A great api is hard to find
Dan Diephouse
 
PDF
Legacy is Good
Uberto Barbini
 
PDF
How Bankwest delivers business value through modern RESTful APIs with Java in...
Rob Crowley
 
PPTX
Leapfrogging with legacy
clive boulton
 
PPTX
Feature driven agile oriented web applications
Ram G Athreya
 
PDF
Jamaza Services
Jamaza
 
KEY
Web frameworks don't matter
Tomas Doran
 
PDF
Bringing banking to digital
Azrul MADISA
 
PPTX
apidays LIVE Hong Kong - The Future of Legacy - How to leverage legacy and on...
apidays
 
PDF
Rails, ExtJs, and Netzke
netzke
 
PDF
Django è pronto per l'Enterprise
PyCon Italia
 
PPTX
It iyer , akansha, samoneh , david & rahul
Rahul Singh
 
PDF
Agile enterprise
Nick Karamolegos
 
PPTX
Building Large Scale PHP Web Applications with Laravel 4
Darwin Biler
 
PPTX
Software Development Whats & Whys
Harun Yardımcı
 
PDF
OWASP Poland Day 2018 - Anthony Fielding and William Jardine - Common App Vulns
OWASP
 
PDF
Putting legacy to REST with middleware
Adam Culp
 
PPT
Software Engineering in PHP
M A Hossain Tonu
 
KEY
Why You Need a Front End Developer
Mike Wilcox
 
PDF
Refactoring legacy systems using events commands and bubble contexts
Michał Kurzeja
 
PDF
Kolejkowanie w systemach multi-tenant - PHPCon 2023
Michał Kurzeja
 

More Related Content

Similar to Strangler Pattern in practice @PHPers Day 2019 (20)

KEY
Modular Web Applications With Netzke
netzke
 
PPTX
A great api is hard to find
Dan Diephouse
 
PDF
Legacy is Good
Uberto Barbini
 
PDF
How Bankwest delivers business value through modern RESTful APIs with Java in...
Rob Crowley
 
PPTX
Leapfrogging with legacy
clive boulton
 
PPTX
Feature driven agile oriented web applications
Ram G Athreya
 
PDF
Jamaza Services
Jamaza
 
KEY
Web frameworks don't matter
Tomas Doran
 
PDF
Bringing banking to digital
Azrul MADISA
 
PPTX
apidays LIVE Hong Kong - The Future of Legacy - How to leverage legacy and on...
apidays
 
PDF
Rails, ExtJs, and Netzke
netzke
 
PDF
Django è pronto per l'Enterprise
PyCon Italia
 
PPTX
It iyer , akansha, samoneh , david & rahul
Rahul Singh
 
PDF
Agile enterprise
Nick Karamolegos
 
PPTX
Building Large Scale PHP Web Applications with Laravel 4
Darwin Biler
 
PPTX
Software Development Whats & Whys
Harun Yardımcı
 
PDF
OWASP Poland Day 2018 - Anthony Fielding and William Jardine - Common App Vulns
OWASP
 
PDF
Putting legacy to REST with middleware
Adam Culp
 
PPT
Software Engineering in PHP
M A Hossain Tonu
 
KEY
Why You Need a Front End Developer
Mike Wilcox
 
Modular Web Applications With Netzke
netzke
 
A great api is hard to find
Dan Diephouse
 
Legacy is Good
Uberto Barbini
 
How Bankwest delivers business value through modern RESTful APIs with Java in...
Rob Crowley
 
Leapfrogging with legacy
clive boulton
 
Feature driven agile oriented web applications
Ram G Athreya
 
Jamaza Services
Jamaza
 
Web frameworks don't matter
Tomas Doran
 
Bringing banking to digital
Azrul MADISA
 
apidays LIVE Hong Kong - The Future of Legacy - How to leverage legacy and on...
apidays
 
Rails, ExtJs, and Netzke
netzke
 
Django è pronto per l'Enterprise
PyCon Italia
 
It iyer , akansha, samoneh , david & rahul
Rahul Singh
 
Agile enterprise
Nick Karamolegos
 
Building Large Scale PHP Web Applications with Laravel 4
Darwin Biler
 
Software Development Whats & Whys
Harun Yardımcı
 
OWASP Poland Day 2018 - Anthony Fielding and William Jardine - Common App Vulns
OWASP
 
Putting legacy to REST with middleware
Adam Culp
 
Software Engineering in PHP
M A Hossain Tonu
 
Why You Need a Front End Developer
Mike Wilcox
 

More from Michał Kurzeja (12)

PDF
Refactoring legacy systems using events commands and bubble contexts
Michał Kurzeja
 
PDF
Kolejkowanie w systemach multi-tenant - PHPCon 2023
Michał Kurzeja
 
PDF
Rozszerzalność Symfony - PHPCon 2023
Michał Kurzeja
 
PDF
Event-driven architecture, the easy way.pdf
Michał Kurzeja
 
PDF
Rozszerzalność aplikacji Symfony
Michał Kurzeja
 
PDF
Docker reverse proxy z użyciem Traefik
Michał Kurzeja
 
PDF
Symfony messenger - PHPers Summit 2019
Michał Kurzeja
 
PDF
Kubernetes - 0 do 1 - 4Developers Warszawa 2019
Michał Kurzeja
 
PPTX
Serverless Architecture
Michał Kurzeja
 
PDF
Docker workshop
Michał Kurzeja
 
PDF
Docker - introduction
Michał Kurzeja
 
PPTX
Symfony2 - garść porad
Michał Kurzeja
 
Refactoring legacy systems using events commands and bubble contexts
Michał Kurzeja
 
Kolejkowanie w systemach multi-tenant - PHPCon 2023
Michał Kurzeja
 
Rozszerzalność Symfony - PHPCon 2023
Michał Kurzeja
 
Event-driven architecture, the easy way.pdf
Michał Kurzeja
 
Rozszerzalność aplikacji Symfony
Michał Kurzeja
 
Docker reverse proxy z użyciem Traefik
Michał Kurzeja
 
Symfony messenger - PHPers Summit 2019
Michał Kurzeja
 
Kubernetes - 0 do 1 - 4Developers Warszawa 2019
Michał Kurzeja
 
Serverless Architecture
Michał Kurzeja
 
Docker workshop
Michał Kurzeja
 
Docker - introduction
Michał Kurzeja
 
Symfony2 - garść porad
Michał Kurzeja
 
Ad

Recently uploaded (20)

PDF
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
digitaljignect
 
PPTX
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
PDF
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
 
PDF
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
PDF
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
PPTX
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
PDF
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
PDF
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 
PDF
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
PDF
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
PDF
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
PDF
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
PDF
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
PDF
The Growing Value and Application of FME & GenAI
Safe Software
 
PDF
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
PDF
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
PDF
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
PDF
Agentic AI for Developers and Data Scientists Build an AI Agent in 10 Lines o...
All Things Open
 
PPTX
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
PDF
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
WebdriverIO & JavaScript: The Perfect Duo for Web Automation
digitaljignect
 
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
"Scaling in space and time with Temporal", Andriy Lupa.pdf
Fwdays
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
AI Agents and FME: A How-to Guide on Generating Synthetic Metadata
Safe Software
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
Securing AI - There Is No Try, Only Do!.pdf
Priyanka Aash
 
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
The Growing Value and Application of FME & GenAI
Safe Software
 
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
Agentic AI for Developers and Data Scientists Build an AI Agent in 10 Lines o...
All Things Open
 
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
Ad

Strangler Pattern in practice @PHPers Day 2019

  • 1. D R S T R A N G L E R 
 & M R H Y P E S T R A N G L E R PAT T E R N I N P R A C T I C E
  • 2. Michał Kurzeja CTO @ Accesto TW: @michalKurzeja [email protected]
  • 3. T H I S TA L K S I S A B O U T • Where legacy comes from? • Why it is worth to get rid of legacy… • … and how to make it properly? • How not to hurt yourself • Examples
  • 4. T H I S TA L K I S N O T A B O U T • How to test • How to refactor classes/methods • Silver bullet step-by-step approach
  • 5. Bad practices „Mr Hype” Good practices
 „Dr Strangler”
  • 6. L E G A C Y C O D E
  • 8. L E G A C Y ! = I N H E R I T E D C O D E
  • 9. E X P E C TAT I O N S
  • 10. R E A L I T Y
  • 11. Q U A L I T Y D E C R E A S E S I N T I M E - L A C K O F T H E „ B O Y S C O U T ” R U L E 0 17,5 35 52,5 70 2010 2011 2012 2013
  • 12. R E S U LT S ? I S S U E S : • Complicated code • Harder to write tests • Difficult deployment • Reluctance of developers • Hard to develop
  • 13. H O W T O C O N V I N C E B U S I N E S S • Slower development • competitors might be faster • increased costs • HR issues: harder recruitment, more people leaving • Lots of bugs, angry customers • It might explode at any time ;)
  • 14. 2 0 1 2 , K N I G H T C A P I TA L G R O U P $460 mln loss in 45 minutes
  • 15. W H AT C A N W E D O ?
  • 16. R E W R I T E F R O M S C R AT C H
  • 17. F R O M 9 0 % T O 0 % O F M A R K E T S H A R E D E C L I N E O F N E T S C A P E L O S T I T T O I N T E R N E T E X P L O R E R !
  • 18. K E E P O N G O I N G
  • 19. R E FA C T O R ?
  • 21. Rewrite from scratchKeep on going Refactor STRANGLE! FUN RISK
  • 22. S T R A N G L E R PAT T E R N
  • 29. G AT E WAY / FA C A D E
  • 30. G AT E WAY - B U I L D I T L E A N server {
 listen 80;
 server_name domain.com;
 
 location /profile {
 proxy_pass http://10.0.3.10:80;
 }
 
 location /news {
 proxy_pass http://10.0.3.10:80;
 }
 
 proxy_pass http://10.0.3.20:80;
 }
  • 31. G AT E WAY - P O S S I B L E S O L U T I O N S • API - Open Source • Kong • API - Paid • AWS API Gateway • WWW • HaProxy • Nginx/Apache/…
  • 32. S TA R T W I T H C AT C H A L L
  • 34. S H A R E D D ATA B A S E
  • 35. D I S T R I B U T E D S H I T
  • 36. S P L I T D ATA B A S E S • Scheduled sync (cron) • Events (required change in legacy) • DB Triggers • Transaction log (Binlog -> Kafka)
  • 37. A P I
  • 39. B O U N D A R I E S
  • 41. A C L
  • 48. L E G A C Y I N A B O X
  • 51. I N P R A C T I C E
  • 52. L O N G T I M E A G O … • Market leader • Project started in 2010, we took over in 2016 • Customers: banks, political parties - no downtime allowed ;)
  • 53. N O F R O N T- C O N T R O L L E R
  • 54. „ C U T E ” V E R S I O N I N G
  • 55. „ M A G I C ” S T R U C T U R E
  • 56. „ B U L L E T P R O O F ” C O N F I G It was $_SERVER[SERVER_NAME];
  • 57. „ R E A D A B L E ” C O D E
  • 59. S E V E R A L G R AY H A I R L AT E R
  • 60. • Monorepo • Apache as facade • Anti-Corruption Layer -> API • JSON Web Token • Configuration by env variables
  • 62. • 100% automated deployment (on Kubernetes) • Business is very happy • Programmers are still alive (and work for us)
  • 63. M I S TA K E S 
 W H AT C O U L D B E D O N E B E T T E R
  • 64. F E AT U R E T O G G L E
  • 65. J W T F R O M D AY 1 0
  • 66. B E T T E R A C L
  • 67. I S S U E S
  • 68. P R O S • Small risk, less stress, quick releases • Instant effects • Both business and developers happy
  • 69. S E C O N D A P P R O A C H - A C L * * M O D I F I E D A B I T
  • 70. M O D E R N A C L L E G A C Y https://github.com/VaughnVernon/IDDD_Samples/tree/master/iddd_collaboration/src/main/java/com/saasovation/ collaboration/port/adapter/service
  • 71. M O D E R N A C L L E G A C Y APIREPO
  • 72. class Currency { private $isoCode; private $default; private $ratio; } M O D E R N - C U R R E N C Y M O D E L
  • 73. interface CurrencyRepository { public function findAll(); public function getDefault(); public function find(string $isoCode); public function save(Currency $currency); } M O D E R N - C U R R E N C Y R E P O S I T O RY
  • 74. class Internal_CurrencyController extends Internal_Controller_InternalController { public function listcurrenciesAction() { $this->checkIp(); $this->getResponse()->setHeader('Content-type', 'application/json'); $mCurrency = new Default_Model_Currency(); /** @var Zend_Db_Table_Rowset $currencies */ $currencies = $mCurrency->fetchAll('status = "active"'); $this->getResponse() ->setBody(json_encode($currencies->toArray())) ->setHttpResponseCode(200); } } L E G A C Y - C U R R E N C Y FA C A D E
  • 75. interface CurrencyAdapter { public function findAll(): array; } A C L - C U R R E N C Y A P I I N T E R FA C E
  • 76. class LegacyCurrencyAdapter implements CurrencyAdapter { public function findAll(): array { $response = $this->client->request('GET', 'listCurrencies'); $currencies = json_decode((string) $response->getBody(), true); return array_map(function ($row) { $currency = $this->currencyTranslator->createFromArray($row); if ($exCurrency = $this->currRepo->find($currency->isoCode())) { $currency->setRatio($exCurrency->getRatio()); $currency->setDefault($exCurrency->getDefault()); } return $currency; }, $currencies); } } A C L - C U R R E N C Y A P I
  • 77. class LegacyCurrencyTranslator implements CurrencyTranslator { public function createFromArray(array $data) { $default = filter_var($data['default'], FILTER_VALIDATE_BOOLEAN); $ratio = filter_var($data['value'], FILTER_VALIDATE_FLOAT); return new Currency($data['code'], $ratio, $default); } } A C L - C U R R E N C Y T R A N S L AT O R
  • 78. W H AT N O T T O D O
  • 79. R O U T I N G I N L E G A C Y / M O D E R N
  • 80. L A C K O F A N T I - C O R R U P T I O N L AY E R
  • 81. P L A N F I R S T, C O D E L AT E R
  • 83. GETTING STARTED WITH DDD WHEN SURROUNDED BY LEGACY SYSTEMS E R I C E VA N S
  • 85. W R I T E S O F T WA R E T H AT I S E A S Y T O S T R A N G L E
  • 86. Michał Kurzeja CTO @ Accesto @michalKurzeja [email protected] Thanks!