SlideShare a Scribd company logo
Migration of a legacy project to Symfony
Juraj Šurman <jsurman@pixelfederation.com>
21.02.2019
www.pixelfederation.com
Migration of a legacy projectto Symfony
What does "Spaghetti code" mean?
Opposite of SOLID => STUPID
• Singleton
• Tight Coupling
• Untestability
• Premature Optimization
• Indescriptive Naming
• Duplication
www.pixelfederation.com
Migration of a legacy projectto Symfony
What "Spaghetti code" means?
www.pixelfederation.com
Migration of a legacy projectto Symfony
REFACTORING !!! ???
www.pixelfederation.com
Migration of a legacy projectto Symfony
Why dual side by side migration of the project?
Why not rewritting everything from scratch?
A valid question, but:
•no time (or too little) for complete rewrite in production
•business value is questionable for the business owner/producer
•risk of introducing new errors into production
•complex framework hacking to glue both systems together
What are the pros actually?
•Continuous transition + Continuous development on existing code
•Lower risk of introducing global errors, smaller errors with smaller impact still possible
•Faster and easier deployment into production
•It is easier to rewrite it part by part - in small chunks
•=== You will have a less nervous producer = almost happy :) ===
www.pixelfederation.com
Migration of a legacy projectto Symfony
Why Symfony?
There are so many Frameworks … why Symfony?
• one of the best PHP Frameworks
• developers more skilled than us design and maintain the framework
• ongoing development with guaranteed backwards compatibility
• we use it on new internal projects
• supported by SensioLabs
• highest quality code base in open source PHP world
• creates best practices
• integration of many libraries through bundles out of the box
www.pixelfederation.com
Migration of a legacy projectto Symfony
How did we start?
Boot legacy app
The main idea is to have one bundle where you implement boot() where you boot the legacy app.
Or when you are using symfony 4 override boot() in your AppKernel.php
www.pixelfederation.com
Migration of a legacy projectto Symfony
www.pixelfederation.com
Migration of a legacy projectto Symfony
How did we start?
Create your router - using Dynamic Router
DynamicRouter - http://symfony.com/doc/current/cmf/bundles/routing/dynamic.html
• This router implementation is configured to load routes from a RouteProviderInterface.
• You will have ChainRouter instead of Router in @router service
• ChainRouter has configuration of routers by ID
• router.default (origin router) [with top of priority]
• cmf_routing.dynamic_router
• Dynamic router has dependency on RouteProviderInterface
• Create own class implementing the RouteProviderInterface
• You need to create FinalMatcher, because all requests try to match by path info
www.pixelfederation.com
Migration of alegacy projectto Symfony
How did we start?
Aliases of old routes to a new ones
Example of route:
Our legacy “FW” uses the “a” param from GET/POST this way: “?a=api-filelist/init”
1.Created an instance of the original ApiFileList controller in the boot() method [previous slide]
2.The controller was injected into the Symfony container
3.This request created an instance of the old ApiFilelistController
4.Created ApiFilelistController in Symfony as well - naming conventions don't matter
5.Implemented an action e.g. initAction
?a=api-filelist/init === ApiFilelist_init
The following annotation should be used on this method:
@RestPost("/device/api-filelist/init", name=“ApiFilelist_init”)
Now your controllers in Symfony listen to legacy request.
Second option:
1.create only a proxy to the old server
2.get instance of a legacy controller from the container
3.call the controller action
www.pixelfederation.com
Migration of legacy projectto Symfony
What else?
HTML Front - End
Migrate all HTML outputs and assets to Symfony - I recommend it.
Access from Symfony to legacy services?
Old services are registered in “dic” (Pimple)
Usage in the old server code: $dic[AppServiceLocalizations::class];
Usage in Symfony services.yml: ‘@=service("dic").offsetGet("AppServiceLocalizations")'
Autowire old services to new Symfony services
service.yaml
AppServiceLocalizations:
factory: 'PixelFederationBundleServerMigrationBundleServiceDicFactoryProxy:factoryService'
arguments: ['AppServiceLocalizations']
www.pixelfederation.com
Migration of legacy projectto Symfony
Next steps?
Rewrite, test, production, rewrite, test, production, rewrite…
• Start refactoring with services which are needed to be changed, because of a new feature or some optimisation
-> move refactored services from legacy namespace to the “correct/clear” place for better distinguishing
www.pixelfederation.com
Migration of legacy projectto Symfony
What have we learned?
It’s easy (now) - you can start right now :)
• just don't be afraid to do it (of course, your boss must know about it and agree with it)
• If we use Symfony in our projects, we will able to use compatible packages developed by us and by the world
community
• Better programmer recycling (moving between projects)
• We will not have a rigid framework - The world community is developing it
• Easier to use current best practices - we do not need to develop them on our own
• New programmers are introduced into the developing process more easily (they already know the technologies)
• Programmer has maximum time on project (creative part of work) instead of reading of tons and tons of
spaghetti code
• Framework Documentation + stack overflow
• Tons of bundles/plugins/modules
www.pixelfederation.com
Migration of a legacy projectto Symfony
Thank you.
Ad

More Related Content

What's hot (20)

【Unite Tokyo 2019】Unityプログレッシブライトマッパー2019
【Unite Tokyo 2019】Unityプログレッシブライトマッパー2019【Unite Tokyo 2019】Unityプログレッシブライトマッパー2019
【Unite Tokyo 2019】Unityプログレッシブライトマッパー2019
UnityTechnologiesJapan002
 
Level design and devlopment part 1 introduction to level design
Level design and devlopment part 1  introduction to level designLevel design and devlopment part 1  introduction to level design
Level design and devlopment part 1 introduction to level design
Durgesh Pandey
 
Niagara In UE4
Niagara In UE4Niagara In UE4
Niagara In UE4
Dae Hyek KIM
 
Ling304 assignment2 12127013
Ling304 assignment2 12127013Ling304 assignment2 12127013
Ling304 assignment2 12127013
Amina Magaji
 
Introduction to the Theory of Game Elements
Introduction to the Theory of Game ElementsIntroduction to the Theory of Game Elements
Introduction to the Theory of Game Elements
Aki Järvinen
 
The Hack Spectrum: Tips, Tricks, and Hacks for Unity
The Hack Spectrum: Tips, Tricks, and Hacks for UnityThe Hack Spectrum: Tips, Tricks, and Hacks for Unity
The Hack Spectrum: Tips, Tricks, and Hacks for Unity
Ryan Hipple
 
레벨 디자인 튜토리얼: 엄폐물
레벨 디자인 튜토리얼: 엄폐물레벨 디자인 튜토리얼: 엄폐물
레벨 디자인 튜토리얼: 엄폐물
용태 이
 
The Importance of the Player in Game Design
The Importance of the Player in Game DesignThe Importance of the Player in Game Design
The Importance of the Player in Game Design
Rui Prada
 
Introduction to Unity3D and Building your First Game
Introduction to Unity3D and Building your First GameIntroduction to Unity3D and Building your First Game
Introduction to Unity3D and Building your First Game
Sarah Sexton
 
유니티 + Nodejs를 활용한 멀티플레이어 게임 개발하기
유니티 + Nodejs를 활용한 멀티플레이어 게임 개발하기유니티 + Nodejs를 활용한 멀티플레이어 게임 개발하기
유니티 + Nodejs를 활용한 멀티플레이어 게임 개발하기
Kiyoung Moon
 
Anatomy of a Texture Fetch
Anatomy of a Texture FetchAnatomy of a Texture Fetch
Anatomy of a Texture Fetch
Mark Kilgard
 
Swift Programming Language
Swift Programming LanguageSwift Programming Language
Swift Programming Language
Giuseppe Arici
 
Communicating Sequential Processes (CSP) in JavaScript
Communicating Sequential Processes (CSP) in JavaScriptCommunicating Sequential Processes (CSP) in JavaScript
Communicating Sequential Processes (CSP) in JavaScript
Max Klymyshyn
 
Level design and devlopment part 2 stories and narrative
Level design and devlopment part 2  stories and narrativeLevel design and devlopment part 2  stories and narrative
Level design and devlopment part 2 stories and narrative
Durgesh Pandey
 
게임제작개론 9
게임제작개론 9게임제작개론 9
게임제작개론 9
Seokmin No
 
The role of context in interpretation
The role of context in interpretationThe role of context in interpretation
The role of context in interpretation
H. R. Marasabessy
 
The Sight in a mirror 게임 개발 기술문서
The Sight in a mirror 게임 개발 기술문서The Sight in a mirror 게임 개발 기술문서
The Sight in a mirror 게임 개발 기술문서
ssuser641680
 
[2019] 퍼즐 게임 난이도 예측은 닥터 P에게
[2019] 퍼즐 게임 난이도 예측은 닥터 P에게[2019] 퍼즐 게임 난이도 예측은 닥터 P에게
[2019] 퍼즐 게임 난이도 예측은 닥터 P에게
NHN FORWARD
 
Deixis presentation
Deixis presentationDeixis presentation
Deixis presentation
Ijaz Ahmed
 
16.03.24 sos project 컨셉 기획서_남진우
16.03.24 sos project 컨셉 기획서_남진우16.03.24 sos project 컨셉 기획서_남진우
16.03.24 sos project 컨셉 기획서_남진우
Nam Jinwoo
 
【Unite Tokyo 2019】Unityプログレッシブライトマッパー2019
【Unite Tokyo 2019】Unityプログレッシブライトマッパー2019【Unite Tokyo 2019】Unityプログレッシブライトマッパー2019
【Unite Tokyo 2019】Unityプログレッシブライトマッパー2019
UnityTechnologiesJapan002
 
Level design and devlopment part 1 introduction to level design
Level design and devlopment part 1  introduction to level designLevel design and devlopment part 1  introduction to level design
Level design and devlopment part 1 introduction to level design
Durgesh Pandey
 
Ling304 assignment2 12127013
Ling304 assignment2 12127013Ling304 assignment2 12127013
Ling304 assignment2 12127013
Amina Magaji
 
Introduction to the Theory of Game Elements
Introduction to the Theory of Game ElementsIntroduction to the Theory of Game Elements
Introduction to the Theory of Game Elements
Aki Järvinen
 
The Hack Spectrum: Tips, Tricks, and Hacks for Unity
The Hack Spectrum: Tips, Tricks, and Hacks for UnityThe Hack Spectrum: Tips, Tricks, and Hacks for Unity
The Hack Spectrum: Tips, Tricks, and Hacks for Unity
Ryan Hipple
 
레벨 디자인 튜토리얼: 엄폐물
레벨 디자인 튜토리얼: 엄폐물레벨 디자인 튜토리얼: 엄폐물
레벨 디자인 튜토리얼: 엄폐물
용태 이
 
The Importance of the Player in Game Design
The Importance of the Player in Game DesignThe Importance of the Player in Game Design
The Importance of the Player in Game Design
Rui Prada
 
Introduction to Unity3D and Building your First Game
Introduction to Unity3D and Building your First GameIntroduction to Unity3D and Building your First Game
Introduction to Unity3D and Building your First Game
Sarah Sexton
 
유니티 + Nodejs를 활용한 멀티플레이어 게임 개발하기
유니티 + Nodejs를 활용한 멀티플레이어 게임 개발하기유니티 + Nodejs를 활용한 멀티플레이어 게임 개발하기
유니티 + Nodejs를 활용한 멀티플레이어 게임 개발하기
Kiyoung Moon
 
Anatomy of a Texture Fetch
Anatomy of a Texture FetchAnatomy of a Texture Fetch
Anatomy of a Texture Fetch
Mark Kilgard
 
Swift Programming Language
Swift Programming LanguageSwift Programming Language
Swift Programming Language
Giuseppe Arici
 
Communicating Sequential Processes (CSP) in JavaScript
Communicating Sequential Processes (CSP) in JavaScriptCommunicating Sequential Processes (CSP) in JavaScript
Communicating Sequential Processes (CSP) in JavaScript
Max Klymyshyn
 
Level design and devlopment part 2 stories and narrative
Level design and devlopment part 2  stories and narrativeLevel design and devlopment part 2  stories and narrative
Level design and devlopment part 2 stories and narrative
Durgesh Pandey
 
게임제작개론 9
게임제작개론 9게임제작개론 9
게임제작개론 9
Seokmin No
 
The role of context in interpretation
The role of context in interpretationThe role of context in interpretation
The role of context in interpretation
H. R. Marasabessy
 
The Sight in a mirror 게임 개발 기술문서
The Sight in a mirror 게임 개발 기술문서The Sight in a mirror 게임 개발 기술문서
The Sight in a mirror 게임 개발 기술문서
ssuser641680
 
[2019] 퍼즐 게임 난이도 예측은 닥터 P에게
[2019] 퍼즐 게임 난이도 예측은 닥터 P에게[2019] 퍼즐 게임 난이도 예측은 닥터 P에게
[2019] 퍼즐 게임 난이도 예측은 닥터 P에게
NHN FORWARD
 
Deixis presentation
Deixis presentationDeixis presentation
Deixis presentation
Ijaz Ahmed
 
16.03.24 sos project 컨셉 기획서_남진우
16.03.24 sos project 컨셉 기획서_남진우16.03.24 sos project 컨셉 기획서_남진우
16.03.24 sos project 컨셉 기획서_남진우
Nam Jinwoo
 

Similar to Migration of a legacy project to Symfony (20)

Symfony 4: A new way to develop applications #ipc19
Symfony 4: A new way to develop applications #ipc19Symfony 4: A new way to develop applications #ipc19
Symfony 4: A new way to develop applications #ipc19
Antonio Peric-Mazar
 
Symfony 4: A new way to develop applications #phpsrb
 Symfony 4: A new way to develop applications #phpsrb Symfony 4: A new way to develop applications #phpsrb
Symfony 4: A new way to develop applications #phpsrb
Antonio Peric-Mazar
 
SymfonyCon Cluj 2017 - Symfony at OpenSky
SymfonyCon Cluj 2017 - Symfony at OpenSkySymfonyCon Cluj 2017 - Symfony at OpenSky
SymfonyCon Cluj 2017 - Symfony at OpenSky
Pablo Godel
 
ServerSentEvents.pdf
ServerSentEvents.pdfServerSentEvents.pdf
ServerSentEvents.pdf
Alessandro Minoccheri
 
Your easy move to serverless computing and radically simplified data processing
Your easy move to serverless computing and radically simplified data processingYour easy move to serverless computing and radically simplified data processing
Your easy move to serverless computing and radically simplified data processing
Big Data Value Association
 
Build Your First SharePoint Framework Webpart
Build Your First SharePoint Framework WebpartBuild Your First SharePoint Framework Webpart
Build Your First SharePoint Framework Webpart
Eric Overfield
 
Symfony Live San Francisco 2017 - Symfony @ OpenSky
Symfony Live San Francisco 2017 - Symfony @ OpenSkySymfony Live San Francisco 2017 - Symfony @ OpenSky
Symfony Live San Francisco 2017 - Symfony @ OpenSky
Pablo Godel
 
Hands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkHands-on with the Symfony2 Framework
Hands-on with the Symfony2 Framework
Ryan Weaver
 
Your easy move to serverless computing and radically simplified data processing
Your easy move to serverless computing and radically simplified data processingYour easy move to serverless computing and radically simplified data processing
Your easy move to serverless computing and radically simplified data processing
gvernik
 
Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"
Fwdays
 
JBoss BPM Suite 6 Tech labs
JBoss BPM Suite 6 Tech labsJBoss BPM Suite 6 Tech labs
JBoss BPM Suite 6 Tech labs
Andrea Leoncini
 
What is new in Symfony 3,3, 3,4, 4.0, 4,1 + Flex
What is new in Symfony 3,3, 3,4, 4.0, 4,1 + FlexWhat is new in Symfony 3,3, 3,4, 4.0, 4,1 + Flex
What is new in Symfony 3,3, 3,4, 4.0, 4,1 + Flex
Haehnchen
 
Symfony4 - Deep dive
Symfony4 - Deep diveSymfony4 - Deep dive
Symfony4 - Deep dive
Salma Ghareeb
 
Symfony framework-An overview and usability for web development
Symfony framework-An overview and usability for web developmentSymfony framework-An overview and usability for web development
Symfony framework-An overview and usability for web development
ifour_bhavesh
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
Fabien Potencier
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Fabrice Bernhard
 
DevOps Spain 2019. Pedro Mendoza-AWS
DevOps Spain 2019. Pedro Mendoza-AWSDevOps Spain 2019. Pedro Mendoza-AWS
DevOps Spain 2019. Pedro Mendoza-AWS
atSistemas
 
JAX 2014 - The PaaS to a better IT architecture.
JAX 2014 - The PaaS to a better IT architecture.JAX 2014 - The PaaS to a better IT architecture.
JAX 2014 - The PaaS to a better IT architecture.
Sebastian Faulhaber
 
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...
Les-Tilleuls.coop
 
Symfony2 San Francisco Meetup 2009
Symfony2 San Francisco Meetup 2009Symfony2 San Francisco Meetup 2009
Symfony2 San Francisco Meetup 2009
Fabien Potencier
 
Symfony 4: A new way to develop applications #ipc19
Symfony 4: A new way to develop applications #ipc19Symfony 4: A new way to develop applications #ipc19
Symfony 4: A new way to develop applications #ipc19
Antonio Peric-Mazar
 
Symfony 4: A new way to develop applications #phpsrb
 Symfony 4: A new way to develop applications #phpsrb Symfony 4: A new way to develop applications #phpsrb
Symfony 4: A new way to develop applications #phpsrb
Antonio Peric-Mazar
 
SymfonyCon Cluj 2017 - Symfony at OpenSky
SymfonyCon Cluj 2017 - Symfony at OpenSkySymfonyCon Cluj 2017 - Symfony at OpenSky
SymfonyCon Cluj 2017 - Symfony at OpenSky
Pablo Godel
 
Your easy move to serverless computing and radically simplified data processing
Your easy move to serverless computing and radically simplified data processingYour easy move to serverless computing and radically simplified data processing
Your easy move to serverless computing and radically simplified data processing
Big Data Value Association
 
Build Your First SharePoint Framework Webpart
Build Your First SharePoint Framework WebpartBuild Your First SharePoint Framework Webpart
Build Your First SharePoint Framework Webpart
Eric Overfield
 
Symfony Live San Francisco 2017 - Symfony @ OpenSky
Symfony Live San Francisco 2017 - Symfony @ OpenSkySymfony Live San Francisco 2017 - Symfony @ OpenSky
Symfony Live San Francisco 2017 - Symfony @ OpenSky
Pablo Godel
 
Hands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkHands-on with the Symfony2 Framework
Hands-on with the Symfony2 Framework
Ryan Weaver
 
Your easy move to serverless computing and radically simplified data processing
Your easy move to serverless computing and radically simplified data processingYour easy move to serverless computing and radically simplified data processing
Your easy move to serverless computing and radically simplified data processing
gvernik
 
Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"
Fwdays
 
JBoss BPM Suite 6 Tech labs
JBoss BPM Suite 6 Tech labsJBoss BPM Suite 6 Tech labs
JBoss BPM Suite 6 Tech labs
Andrea Leoncini
 
What is new in Symfony 3,3, 3,4, 4.0, 4,1 + Flex
What is new in Symfony 3,3, 3,4, 4.0, 4,1 + FlexWhat is new in Symfony 3,3, 3,4, 4.0, 4,1 + Flex
What is new in Symfony 3,3, 3,4, 4.0, 4,1 + Flex
Haehnchen
 
Symfony4 - Deep dive
Symfony4 - Deep diveSymfony4 - Deep dive
Symfony4 - Deep dive
Salma Ghareeb
 
Symfony framework-An overview and usability for web development
Symfony framework-An overview and usability for web developmentSymfony framework-An overview and usability for web development
Symfony framework-An overview and usability for web development
ifour_bhavesh
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
Fabien Potencier
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Fabrice Bernhard
 
DevOps Spain 2019. Pedro Mendoza-AWS
DevOps Spain 2019. Pedro Mendoza-AWSDevOps Spain 2019. Pedro Mendoza-AWS
DevOps Spain 2019. Pedro Mendoza-AWS
atSistemas
 
JAX 2014 - The PaaS to a better IT architecture.
JAX 2014 - The PaaS to a better IT architecture.JAX 2014 - The PaaS to a better IT architecture.
JAX 2014 - The PaaS to a better IT architecture.
Sebastian Faulhaber
 
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...
Progressively enhance your Symfony 4 app using Vue, API Platform, Mercure and...
Les-Tilleuls.coop
 
Symfony2 San Francisco Meetup 2009
Symfony2 San Francisco Meetup 2009Symfony2 San Francisco Meetup 2009
Symfony2 San Francisco Meetup 2009
Fabien Potencier
 
Ad

More from Pixel Federation (6)

Seaport - Using data to design onboarding
Seaport - Using data to design onboardingSeaport - Using data to design onboarding
Seaport - Using data to design onboarding
Pixel Federation
 
DDD in Pixel Federation v1 | TechForce Meetup vol.3
DDD in Pixel Federation v1 | TechForce Meetup vol.3DDD in Pixel Federation v1 | TechForce Meetup vol.3
DDD in Pixel Federation v1 | TechForce Meetup vol.3
Pixel Federation
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
Pixel Federation
 
Tracing in distributed systems
Tracing in distributed systemsTracing in distributed systems
Tracing in distributed systems
Pixel Federation
 
Running Kubernetes
Running KubernetesRunning Kubernetes
Running Kubernetes
Pixel Federation
 
DDD in Pixel Federation volume 2
DDD in Pixel Federation volume 2DDD in Pixel Federation volume 2
DDD in Pixel Federation volume 2
Pixel Federation
 
Seaport - Using data to design onboarding
Seaport - Using data to design onboardingSeaport - Using data to design onboarding
Seaport - Using data to design onboarding
Pixel Federation
 
DDD in Pixel Federation v1 | TechForce Meetup vol.3
DDD in Pixel Federation v1 | TechForce Meetup vol.3DDD in Pixel Federation v1 | TechForce Meetup vol.3
DDD in Pixel Federation v1 | TechForce Meetup vol.3
Pixel Federation
 
Tracing in distributed systems
Tracing in distributed systemsTracing in distributed systems
Tracing in distributed systems
Pixel Federation
 
DDD in Pixel Federation volume 2
DDD in Pixel Federation volume 2DDD in Pixel Federation volume 2
DDD in Pixel Federation volume 2
Pixel Federation
 
Ad

Recently uploaded (20)

Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 

Migration of a legacy project to Symfony

  • 1. Migration of a legacy project to Symfony Juraj Šurman <[email protected]> 21.02.2019
  • 2. www.pixelfederation.com Migration of a legacy projectto Symfony What does "Spaghetti code" mean? Opposite of SOLID => STUPID • Singleton • Tight Coupling • Untestability • Premature Optimization • Indescriptive Naming • Duplication
  • 3. www.pixelfederation.com Migration of a legacy projectto Symfony What "Spaghetti code" means?
  • 4. www.pixelfederation.com Migration of a legacy projectto Symfony REFACTORING !!! ???
  • 5. www.pixelfederation.com Migration of a legacy projectto Symfony Why dual side by side migration of the project? Why not rewritting everything from scratch? A valid question, but: •no time (or too little) for complete rewrite in production •business value is questionable for the business owner/producer •risk of introducing new errors into production •complex framework hacking to glue both systems together What are the pros actually? •Continuous transition + Continuous development on existing code •Lower risk of introducing global errors, smaller errors with smaller impact still possible •Faster and easier deployment into production •It is easier to rewrite it part by part - in small chunks •=== You will have a less nervous producer = almost happy :) ===
  • 6. www.pixelfederation.com Migration of a legacy projectto Symfony Why Symfony? There are so many Frameworks … why Symfony? • one of the best PHP Frameworks • developers more skilled than us design and maintain the framework • ongoing development with guaranteed backwards compatibility • we use it on new internal projects • supported by SensioLabs • highest quality code base in open source PHP world • creates best practices • integration of many libraries through bundles out of the box
  • 7. www.pixelfederation.com Migration of a legacy projectto Symfony How did we start? Boot legacy app The main idea is to have one bundle where you implement boot() where you boot the legacy app. Or when you are using symfony 4 override boot() in your AppKernel.php
  • 8. www.pixelfederation.com Migration of a legacy projectto Symfony
  • 9. www.pixelfederation.com Migration of a legacy projectto Symfony How did we start? Create your router - using Dynamic Router DynamicRouter - http://symfony.com/doc/current/cmf/bundles/routing/dynamic.html • This router implementation is configured to load routes from a RouteProviderInterface. • You will have ChainRouter instead of Router in @router service • ChainRouter has configuration of routers by ID • router.default (origin router) [with top of priority] • cmf_routing.dynamic_router • Dynamic router has dependency on RouteProviderInterface • Create own class implementing the RouteProviderInterface • You need to create FinalMatcher, because all requests try to match by path info
  • 10. www.pixelfederation.com Migration of alegacy projectto Symfony How did we start? Aliases of old routes to a new ones Example of route: Our legacy “FW” uses the “a” param from GET/POST this way: “?a=api-filelist/init” 1.Created an instance of the original ApiFileList controller in the boot() method [previous slide] 2.The controller was injected into the Symfony container 3.This request created an instance of the old ApiFilelistController 4.Created ApiFilelistController in Symfony as well - naming conventions don't matter 5.Implemented an action e.g. initAction ?a=api-filelist/init === ApiFilelist_init The following annotation should be used on this method: @RestPost("/device/api-filelist/init", name=“ApiFilelist_init”) Now your controllers in Symfony listen to legacy request. Second option: 1.create only a proxy to the old server 2.get instance of a legacy controller from the container 3.call the controller action
  • 11. www.pixelfederation.com Migration of legacy projectto Symfony What else? HTML Front - End Migrate all HTML outputs and assets to Symfony - I recommend it. Access from Symfony to legacy services? Old services are registered in “dic” (Pimple) Usage in the old server code: $dic[AppServiceLocalizations::class]; Usage in Symfony services.yml: ‘@=service("dic").offsetGet("AppServiceLocalizations")' Autowire old services to new Symfony services service.yaml AppServiceLocalizations: factory: 'PixelFederationBundleServerMigrationBundleServiceDicFactoryProxy:factoryService' arguments: ['AppServiceLocalizations']
  • 12. www.pixelfederation.com Migration of legacy projectto Symfony Next steps? Rewrite, test, production, rewrite, test, production, rewrite… • Start refactoring with services which are needed to be changed, because of a new feature or some optimisation -> move refactored services from legacy namespace to the “correct/clear” place for better distinguishing
  • 13. www.pixelfederation.com Migration of legacy projectto Symfony What have we learned? It’s easy (now) - you can start right now :) • just don't be afraid to do it (of course, your boss must know about it and agree with it) • If we use Symfony in our projects, we will able to use compatible packages developed by us and by the world community • Better programmer recycling (moving between projects) • We will not have a rigid framework - The world community is developing it • Easier to use current best practices - we do not need to develop them on our own • New programmers are introduced into the developing process more easily (they already know the technologies) • Programmer has maximum time on project (creative part of work) instead of reading of tons and tons of spaghetti code • Framework Documentation + stack overflow • Tons of bundles/plugins/modules
  • 14. www.pixelfederation.com Migration of a legacy projectto Symfony Thank you.