SlideShare ist ein Scribd-Unternehmen logo
1 von 31
Modernisa0on	
  of	
  legacy	
  PHP	
  applica0ons	
  	
  
                                                          using	
  Symfony2	
  	
  




                               12/10/2012	
     1	
     THEODO	
  
The	
  need	
  for	
  progressive	
  rewrite	
  
	
  
The	
  technical	
  challenges	
  faced	
  
	
  
Theodo	
  Evolu=on	
  




                                                   12/10/2012	
     2	
     THEODO	
  
Total	
  rewrite	
  is	
  dangerous	
  for	
  the	
  business	
  
     Downsides	
  of	
  progressive	
  rewrite	
  




•    New	
  developments	
  are	
  invisible	
  un0l	
  the	
  new	
  version	
  is	
  finished	
  

•    You	
  need	
  twice	
  more	
  developers:	
  one	
  team	
  to	
  maintain	
  the	
  old	
  
     applica0on,	
  while	
  the	
  second	
  team	
  is	
  wri0ng	
  the	
  new	
  version	
  

•    The	
  probability	
  of	
  forgeDng	
  features	
  during	
  the	
  rewrite	
  is	
  high	
  




                                                             12/10/2012	
     3	
     THEODO	
  
Progressive	
  rewrite	
  is	
  a	
  very	
  difficult	
  technical	
  challenge	
  
     The	
  challenge	
  of	
  progressive	
  rewrite	
  




•    It	
  might	
  be	
  hard	
  to	
  make	
  the	
  hos0ng	
  system	
  evolve	
  

•    You	
  have	
  to	
  work	
  with	
  hard-­‐to-­‐read	
  code	
  

•    The	
  exis0ng	
  «	
  spageJhi	
  code	
  »	
  has	
  to	
  be	
  separated	
  into	
  
     independent	
  pieces	
  




                                                                12/10/2012	
     4	
     THEODO	
  
Progressive rewrite is harder but more profitable
                    Graphical	
  comparison	
  
Functionalities




                                                  Functionalities
                                                                                                          Evolu=on	
  




                                      Time                                                         Time


                  • No new features for months • Only 1 app to maintain
                  • 2 apps to maintain         • Lower regression risks
                                               • Unbeatable time-to-market
                                                                    12/10/2012	
     5	
     THEODO	
  
Decoupling	
  is	
  a	
  major	
  aspect	
  of	
  progressive	
  rewrite	
  
Rewrite	
  strategy	
  




                                                 12/10/2012	
     6	
     THEODO	
  
Decoupling	
  is	
  a	
  major	
  aspect	
  of	
  progressive	
  rewrite	
  
Rewrite	
  strategy	
  




                                                 12/10/2012	
     7	
     THEODO	
  
Decoupling	
  is	
  a	
  major	
  aspect	
  of	
  progressive	
  rewrite	
  
Rewrite	
  strategy	
  




                                                 12/10/2012	
     8	
     THEODO	
  
Decoupling	
  is	
  a	
  major	
  aspect	
  of	
  progressive	
  rewrite	
  
Rewrite	
  strategy	
  




                                                 12/10/2012	
     9	
     THEODO	
  
Decoupling	
  is	
  a	
  major	
  aspect	
  of	
  progressive	
  rewrite	
  
Rewrite	
  strategy	
  




                                                 12/10/2012	
   10	
     THEODO	
  
Decoupling	
  is	
  a	
  major	
  aspect	
  of	
  progressive	
  rewrite	
  
Rewrite	
  strategy	
  




                                                 12/10/2012	
   11	
     THEODO	
  
Decoupling	
  is	
  a	
  major	
  aspect	
  of	
  progressive	
  rewrite	
  
Rewrite	
  strategy	
  




                                                 12/10/2012	
   12	
     THEODO	
  
The	
  need	
  for	
  progressive	
  rewrite	
  
	
  
The	
  technical	
  challenges	
  faced	
  
	
  
Theodo	
  Evolu=on	
  




                                                   12/10/2012	
   13	
     THEODO	
  
System	
  comptability	
  
     The	
  challenge	
  of	
  progressive	
  rewrite	
  




•    Symfony2	
  requires:	
  
      •  PHP	
  5.3.2	
  
      •  Sqlite3,	
  JSON,	
  ctype	
  
      •  date.0mezone	
  set	
  in	
  php.ini	
  
•    php	
  app/check.php	
  

•    Blueprint:	
  hJps://github.com/devstructure/blueprint	
  




                                                            12/10/2012	
   14	
     THEODO	
  
Unexpected	
  regressions	
  
     The	
  challenge	
  of	
  progressive	
  rewrite	
  




•    By	
  defini0on,	
  spagheD	
  code	
  is	
  deeply	
  coupled.	
  Improving	
  one	
  
     part	
  can	
  break	
  another	
  	
  

•    Need	
  for	
  func0onal	
  tes0ng	
  on	
  the	
  most	
  cri0cal	
  scenarios	
  

•    Mink:	
  hJps://github.com/Behat/Mink	
  




                                                            12/10/2012	
   15	
     THEODO	
  
Proxying	
  the	
  rou=ng	
  
     The	
  challenge	
  of	
  progressive	
  rewrite	
  




•    The	
  beauty	
  of	
  PHP:	
  some	
  apps	
  have	
  simply	
  no	
  rou0ng!	
  

•    Host	
  the	
  new	
  app	
  next	
  to	
  the	
  old	
  app,	
  with	
  clear	
  URL	
  differences,	
  
     and	
  proxy	
  at	
  the	
  server	
  level	
  
      •  Subdomain:	
  v2.myapp.com	
  
      •  Subfolder:	
  www.myapp.com/v2/	
  
•    If	
  you	
  want	
  to	
  keep	
  the	
  rou0ng:	
  create	
  a	
  catchall	
  route	
  with	
  
     Symfony2	
  



                                                                  12/10/2012	
   16	
     THEODO	
  
Sharing	
  the	
  layout	
  
       The	
  challenge	
  of	
  progressive	
  rewrite	
  


	
  
•      The	
  rewrite	
  needs	
  to	
  be	
  transparent	
  for	
  the	
  app	
  users:	
  both	
  old	
  and	
  
       new	
  apps	
  must	
  use	
  the	
  same	
  layout	
  

•      Copy-­‐pas0ng	
  the	
  layout	
  is	
  not	
  a	
  solu0on:	
  use	
  ESIs	
  with	
  a	
  compa0ble	
  
       Reverse-­‐Proxy	
  
	
  
<esi:include	
  
src="{{	
  path('theodoevolution_layoutrenderer_legacylayout_top')	
  }
}"	
  />	
  
{%	
  block	
  body	
  %}{%	
  endblock	
  %}	
  
<esi:include	
  
src="{{	
  path('theodoevolution_layoutrenderer_legacylayout_bottom'
)	
  }}"	
  />	
  
                                                                  12/10/2012	
   17	
     THEODO	
  
Sharing	
  the	
  session	
  
       The	
  challenge	
  of	
  progressive	
  rewrite	
  


	
  
•      You	
  might	
  want	
  to	
  access	
  some	
  common	
  infos	
  for	
  your	
  user	
  

•      Both	
  apps	
  must	
  be	
  hosted	
  on	
  the	
  same	
  domain	
  to	
  make	
  it	
  easier	
  

•      With	
  Symfony2,	
  add	
  a	
  listener	
  on	
  the	
  kernel.request	
  event	
  that	
  
       triggers	
  a	
  transformer:	
  the	
  session	
  is	
  converted	
  from	
  plain	
  array	
  
       to	
  the	
  Symfony2	
  format	
  




                                                                 12/10/2012	
   18	
     THEODO	
  
The	
  dream	
  architecture	
  
The	
  challenge	
  of	
  progressive	
  rewrite	
  




                                                       12/10/2012	
   19	
     THEODO	
  
What	
  you	
  usually	
  find	
  
The	
  challenge	
  of	
  progressive	
  rewrite	
  




                                                       12/10/2012	
   20	
     THEODO	
  
You	
  need	
  to	
  create	
  the	
  dream	
  API	
  and	
  slowly	
  start	
  using	
  it	
  
                                                                                           	
  
The	
  challenge	
  of	
  progressive	
  rewrite	
  
                                                           A
                  A                                        P
                  P                                        I
                                                                                                    A
                  I                                                                                 P
                                                                                                    I
                                                           A
                                                           P
                                                           I
                               A
                               P
                               I                                                       A
                                                       A                               P
                                                       P
                                                                                       I
                                                       I




                                                               12/10/2012	
   21	
     THEODO	
  
You	
  need	
  to	
  create	
  the	
  dream	
  API	
  and	
  slowly	
  start	
  using	
  it	
  
                                                                                           	
  
The	
  challenge	
  of	
  progressive	
  rewrite	
  
                                                           A
                  A                                        P
                  P                                        I
                                                                                                    A
                  I                                                                                 P
                                                                                                    I
                                                           A
                                                           P
                                                           I
                               A
                               P
                               I                                                       A
                                                       A                               P
                                                       P
                                                                                       I
                                                       I




                                                               12/10/2012	
   22	
     THEODO	
  
You	
  need	
  to	
  create	
  the	
  dream	
  API	
  and	
  slowly	
  start	
  using	
  it	
  
                                                                                           	
  
The	
  challenge	
  of	
  progressive	
  rewrite	
  
                                                           A
                  A                                        P
                  P                                        I
                                                                                                    A
                  I                                                                                 P
                                                                                                    I
                                                           A
                                                           P
                                                           I
                               A
                               P
                               I                                                       A
                                                       A                               P
                                                       P
                                                                                       I
                                                       I




                                                               12/10/2012	
   23	
     THEODO	
  
You	
  need	
  to	
  create	
  the	
  dream	
  API	
  and	
  slowly	
  start	
  using	
  it	
  
                                                                                           	
  
The	
  challenge	
  of	
  progressive	
  rewrite	
  
                                                           A
                  A                                        P
                  P                                        I
                                                                                                    A
                  I                                                                                 P
                                                                                                    I
                                                           A
                                                           P
                                                           I
                               A
                               P
                               I                                                       A
                                                       A                               P
                                                       P
                                                                                       I
                                                       I




                                                               12/10/2012	
   24	
     THEODO	
  
This	
  is	
  called	
  «	
  Facade	
  PaUern	
  »	
  
     The	
  challenge	
  of	
  progressive	
  rewrite	
  


Wikipedia	
  
A	
  facade	
  is	
  an	
  object	
  that	
  provides	
  a	
  simplified	
  interface	
  to	
  a	
  larger	
  
body	
  of	
  code,	
  such	
  as	
  a	
  class	
  library.	
  A	
  facade	
  can:	
  
•  make	
  a	
  so_ware	
  library	
  easier	
  to	
  use,	
  understand	
  and	
  test,	
  since	
  
      the	
  facade	
  has	
  convenient	
  methods	
  for	
  common	
  tasks;	
  
•  make	
  the	
  library	
  more	
  readable,	
  for	
  the	
  same	
  reason;	
  
•  reduce	
  dependencies	
  of	
  outside	
  code	
  on	
  the	
  inner	
  workings	
  of	
  a	
  
      library,	
  since	
  most	
  code	
  uses	
  the	
  facade,	
  thus	
  allowing	
  more	
  
      flexibility	
  in	
  developing	
  the	
  system;	
  
•  wrap	
  a	
  poorly	
  designed	
  collec0on	
  of	
  APIs	
  with	
  a	
  single	
  well-­‐
      designed	
  API	
  (as	
  per	
  task	
  needs).	
  


                                                                 12/10/2012	
   25	
     THEODO	
  
Symfony2	
  Service	
  Container	
  
     The	
  challenge	
  of	
  progressive	
  rewrite	
  




•    With	
  Symfony2,	
  the	
  new	
  API	
  of	
  the	
  Facade	
  PaJern	
  is	
  a	
  service	
  

•    Create	
  a	
  service	
  for	
  every	
  module	
  you	
  iden0fied…	
  and	
  start	
  using	
  
     them!	
  




                                                               12/10/2012	
   26	
     THEODO	
  
Changing	
  the	
  model	
  
     The	
  challenge	
  of	
  progressive	
  rewrite	
  




•    The	
  database	
  is	
  a	
  converging	
  point.	
  Making	
  two	
  models	
  co-­‐exist	
  
     is	
  really	
  hard	
  

•    One	
  solu0on	
  is	
  NoSQL.	
  The	
  flexibility	
  of	
  a	
  DB	
  like	
  MongoDB	
  
     makes	
  it	
  easier.	
  

•    Use	
  /**	
  @MongoDBPreLoad	
  */	
  from	
  the	
  Doctrine	
  ODM	
  

•    No	
  miracle	
  solu0on…	
  YET!	
  J	
  

                                                              12/10/2012	
   27	
     THEODO	
  
Final	
  step:	
  cleaning	
  the	
  old	
  code	
  
The	
  challenge	
  of	
  progressive	
  rewrite	
  




                                                       12/10/2012	
   28	
     THEODO	
  
The	
  need	
  for	
  progressive	
  rewrite	
  
	
  
The	
  technical	
  challenges	
  faced	
  
	
  
Theodo	
  Evolu=on	
  




                                                   12/10/2012	
   29	
     THEODO	
  
Theodo	
  Evolu=on	
  
       Our	
  strategy	
  with	
  progressive	
  rewrite	
  


	
  
•      The	
  Theodo	
  team	
  consists	
  as	
  of	
  today	
  of	
  18	
  excellent	
  web	
  devs	
  

•      Every	
  technical	
  solu0on	
  for	
  progressive	
  rewrite	
  in	
  Symfony2	
  is	
  
       bundled	
  in	
  Theodo	
  Evolu0on	
  

•      Two	
  R&D	
  engineers	
  are	
  now	
  working	
  full-­‐0me	
  on	
  finding	
  new	
  
       solu0ons	
  

•      Goal:	
  make	
  Theodo	
  Evolu0on	
  an	
  out-­‐of-­‐the-­‐box	
  solu0on	
  
	
  
	
  
                                                                 12/10/2012	
   30	
     THEODO	
  
Questions ?

   fabriceb@theodo.fr
            @theodo
        www.theodo.fr



12/10/2012	
   31	
     THEODO	
  

Weitere ähnliche Inhalte

Ähnlich wie Modernisation of legacy php to Symfony 2

Trends in the software industry
Trends in the software industryTrends in the software industry
Trends in the software industryLi SUN
 
Business Process and Software Architecture Model Co-evolution Patterns
Business Process and Software Architecture Model Co-evolution PatternsBusiness Process and Software Architecture Model Co-evolution Patterns
Business Process and Software Architecture Model Co-evolution PatternsPooyan Jamshidi
 
New Features of OBIEE 11.1.1.6.x
New Features of OBIEE 11.1.1.6.x New Features of OBIEE 11.1.1.6.x
New Features of OBIEE 11.1.1.6.x Capgemini
 
Agile at Large Scale - Conference at Agile Tour Brussels
Agile at Large Scale - Conference at Agile Tour BrusselsAgile at Large Scale - Conference at Agile Tour Brussels
Agile at Large Scale - Conference at Agile Tour BrusselsMathieu DESPRIEE
 
Tycho Tutorial (EclipseCon 2012)
Tycho Tutorial (EclipseCon 2012)Tycho Tutorial (EclipseCon 2012)
Tycho Tutorial (EclipseCon 2012)jsievers
 
Aspect Based Sentiment Analysis
Aspect Based Sentiment AnalysisAspect Based Sentiment Analysis
Aspect Based Sentiment AnalysisGaurav kumar
 
Rich Ajax Platform - theEdge 2012 conference presentation
Rich Ajax Platform - theEdge 2012 conference presentationRich Ajax Platform - theEdge 2012 conference presentation
Rich Ajax Platform - theEdge 2012 conference presentationNicko Borodachuk
 
At bruxelles scaling agile - v1.5 slideshare
At bruxelles   scaling agile - v1.5 slideshareAt bruxelles   scaling agile - v1.5 slideshare
At bruxelles scaling agile - v1.5 slideshareHerve Lourdin
 
Hadoop Operations: Starting Out Small / So Your Cluster Isn't Yahoo-sized (yet)
Hadoop Operations: Starting Out Small / So Your Cluster Isn't Yahoo-sized (yet)Hadoop Operations: Starting Out Small / So Your Cluster Isn't Yahoo-sized (yet)
Hadoop Operations: Starting Out Small / So Your Cluster Isn't Yahoo-sized (yet)Michael Arnold
 

Ähnlich wie Modernisation of legacy php to Symfony 2 (12)

Trends in the software industry
Trends in the software industryTrends in the software industry
Trends in the software industry
 
Business Process and Software Architecture Model Co-evolution Patterns
Business Process and Software Architecture Model Co-evolution PatternsBusiness Process and Software Architecture Model Co-evolution Patterns
Business Process and Software Architecture Model Co-evolution Patterns
 
New Features of OBIEE 11.1.1.6.x
New Features of OBIEE 11.1.1.6.x New Features of OBIEE 11.1.1.6.x
New Features of OBIEE 11.1.1.6.x
 
Agile at Large Scale - Conference at Agile Tour Brussels
Agile at Large Scale - Conference at Agile Tour BrusselsAgile at Large Scale - Conference at Agile Tour Brussels
Agile at Large Scale - Conference at Agile Tour Brussels
 
Tycho Tutorial (EclipseCon 2012)
Tycho Tutorial (EclipseCon 2012)Tycho Tutorial (EclipseCon 2012)
Tycho Tutorial (EclipseCon 2012)
 
Aspect Based Sentiment Analysis
Aspect Based Sentiment AnalysisAspect Based Sentiment Analysis
Aspect Based Sentiment Analysis
 
Rich Ajax Platform - theEdge 2012 conference presentation
Rich Ajax Platform - theEdge 2012 conference presentationRich Ajax Platform - theEdge 2012 conference presentation
Rich Ajax Platform - theEdge 2012 conference presentation
 
Enterprise PHP
Enterprise PHPEnterprise PHP
Enterprise PHP
 
Emerasoft Day 2012 - Innowake introduction
Emerasoft Day 2012 - Innowake introductionEmerasoft Day 2012 - Innowake introduction
Emerasoft Day 2012 - Innowake introduction
 
At bruxelles scaling agile - v1.5 slideshare
At bruxelles   scaling agile - v1.5 slideshareAt bruxelles   scaling agile - v1.5 slideshare
At bruxelles scaling agile - v1.5 slideshare
 
Hadoop Operations: Starting Out Small / So Your Cluster Isn't Yahoo-sized (yet)
Hadoop Operations: Starting Out Small / So Your Cluster Isn't Yahoo-sized (yet)Hadoop Operations: Starting Out Small / So Your Cluster Isn't Yahoo-sized (yet)
Hadoop Operations: Starting Out Small / So Your Cluster Isn't Yahoo-sized (yet)
 
Hadoop operations
Hadoop operationsHadoop operations
Hadoop operations
 

Kürzlich hochgeladen

The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 

Kürzlich hochgeladen (20)

The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 

Modernisation of legacy php to Symfony 2

  • 1. Modernisa0on  of  legacy  PHP  applica0ons     using  Symfony2     12/10/2012   1   THEODO  
  • 2. The  need  for  progressive  rewrite     The  technical  challenges  faced     Theodo  Evolu=on   12/10/2012   2   THEODO  
  • 3. Total  rewrite  is  dangerous  for  the  business   Downsides  of  progressive  rewrite   •  New  developments  are  invisible  un0l  the  new  version  is  finished   •  You  need  twice  more  developers:  one  team  to  maintain  the  old   applica0on,  while  the  second  team  is  wri0ng  the  new  version   •  The  probability  of  forgeDng  features  during  the  rewrite  is  high   12/10/2012   3   THEODO  
  • 4. Progressive  rewrite  is  a  very  difficult  technical  challenge   The  challenge  of  progressive  rewrite   •  It  might  be  hard  to  make  the  hos0ng  system  evolve   •  You  have  to  work  with  hard-­‐to-­‐read  code   •  The  exis0ng  «  spageJhi  code  »  has  to  be  separated  into   independent  pieces   12/10/2012   4   THEODO  
  • 5. Progressive rewrite is harder but more profitable Graphical  comparison   Functionalities Functionalities Evolu=on   Time Time • No new features for months • Only 1 app to maintain • 2 apps to maintain • Lower regression risks • Unbeatable time-to-market 12/10/2012   5   THEODO  
  • 6. Decoupling  is  a  major  aspect  of  progressive  rewrite   Rewrite  strategy   12/10/2012   6   THEODO  
  • 7. Decoupling  is  a  major  aspect  of  progressive  rewrite   Rewrite  strategy   12/10/2012   7   THEODO  
  • 8. Decoupling  is  a  major  aspect  of  progressive  rewrite   Rewrite  strategy   12/10/2012   8   THEODO  
  • 9. Decoupling  is  a  major  aspect  of  progressive  rewrite   Rewrite  strategy   12/10/2012   9   THEODO  
  • 10. Decoupling  is  a  major  aspect  of  progressive  rewrite   Rewrite  strategy   12/10/2012   10   THEODO  
  • 11. Decoupling  is  a  major  aspect  of  progressive  rewrite   Rewrite  strategy   12/10/2012   11   THEODO  
  • 12. Decoupling  is  a  major  aspect  of  progressive  rewrite   Rewrite  strategy   12/10/2012   12   THEODO  
  • 13. The  need  for  progressive  rewrite     The  technical  challenges  faced     Theodo  Evolu=on   12/10/2012   13   THEODO  
  • 14. System  comptability   The  challenge  of  progressive  rewrite   •  Symfony2  requires:   •  PHP  5.3.2   •  Sqlite3,  JSON,  ctype   •  date.0mezone  set  in  php.ini   •  php  app/check.php   •  Blueprint:  hJps://github.com/devstructure/blueprint   12/10/2012   14   THEODO  
  • 15. Unexpected  regressions   The  challenge  of  progressive  rewrite   •  By  defini0on,  spagheD  code  is  deeply  coupled.  Improving  one   part  can  break  another     •  Need  for  func0onal  tes0ng  on  the  most  cri0cal  scenarios   •  Mink:  hJps://github.com/Behat/Mink   12/10/2012   15   THEODO  
  • 16. Proxying  the  rou=ng   The  challenge  of  progressive  rewrite   •  The  beauty  of  PHP:  some  apps  have  simply  no  rou0ng!   •  Host  the  new  app  next  to  the  old  app,  with  clear  URL  differences,   and  proxy  at  the  server  level   •  Subdomain:  v2.myapp.com   •  Subfolder:  www.myapp.com/v2/   •  If  you  want  to  keep  the  rou0ng:  create  a  catchall  route  with   Symfony2   12/10/2012   16   THEODO  
  • 17. Sharing  the  layout   The  challenge  of  progressive  rewrite     •  The  rewrite  needs  to  be  transparent  for  the  app  users:  both  old  and   new  apps  must  use  the  same  layout   •  Copy-­‐pas0ng  the  layout  is  not  a  solu0on:  use  ESIs  with  a  compa0ble   Reverse-­‐Proxy     <esi:include   src="{{  path('theodoevolution_layoutrenderer_legacylayout_top')  } }"  />   {%  block  body  %}{%  endblock  %}   <esi:include   src="{{  path('theodoevolution_layoutrenderer_legacylayout_bottom' )  }}"  />   12/10/2012   17   THEODO  
  • 18. Sharing  the  session   The  challenge  of  progressive  rewrite     •  You  might  want  to  access  some  common  infos  for  your  user   •  Both  apps  must  be  hosted  on  the  same  domain  to  make  it  easier   •  With  Symfony2,  add  a  listener  on  the  kernel.request  event  that   triggers  a  transformer:  the  session  is  converted  from  plain  array   to  the  Symfony2  format   12/10/2012   18   THEODO  
  • 19. The  dream  architecture   The  challenge  of  progressive  rewrite   12/10/2012   19   THEODO  
  • 20. What  you  usually  find   The  challenge  of  progressive  rewrite   12/10/2012   20   THEODO  
  • 21. You  need  to  create  the  dream  API  and  slowly  start  using  it     The  challenge  of  progressive  rewrite   A A P P I A I P I A P I A P I A A P P I I 12/10/2012   21   THEODO  
  • 22. You  need  to  create  the  dream  API  and  slowly  start  using  it     The  challenge  of  progressive  rewrite   A A P P I A I P I A P I A P I A A P P I I 12/10/2012   22   THEODO  
  • 23. You  need  to  create  the  dream  API  and  slowly  start  using  it     The  challenge  of  progressive  rewrite   A A P P I A I P I A P I A P I A A P P I I 12/10/2012   23   THEODO  
  • 24. You  need  to  create  the  dream  API  and  slowly  start  using  it     The  challenge  of  progressive  rewrite   A A P P I A I P I A P I A P I A A P P I I 12/10/2012   24   THEODO  
  • 25. This  is  called  «  Facade  PaUern  »   The  challenge  of  progressive  rewrite   Wikipedia   A  facade  is  an  object  that  provides  a  simplified  interface  to  a  larger   body  of  code,  such  as  a  class  library.  A  facade  can:   •  make  a  so_ware  library  easier  to  use,  understand  and  test,  since   the  facade  has  convenient  methods  for  common  tasks;   •  make  the  library  more  readable,  for  the  same  reason;   •  reduce  dependencies  of  outside  code  on  the  inner  workings  of  a   library,  since  most  code  uses  the  facade,  thus  allowing  more   flexibility  in  developing  the  system;   •  wrap  a  poorly  designed  collec0on  of  APIs  with  a  single  well-­‐ designed  API  (as  per  task  needs).   12/10/2012   25   THEODO  
  • 26. Symfony2  Service  Container   The  challenge  of  progressive  rewrite   •  With  Symfony2,  the  new  API  of  the  Facade  PaJern  is  a  service   •  Create  a  service  for  every  module  you  iden0fied…  and  start  using   them!   12/10/2012   26   THEODO  
  • 27. Changing  the  model   The  challenge  of  progressive  rewrite   •  The  database  is  a  converging  point.  Making  two  models  co-­‐exist   is  really  hard   •  One  solu0on  is  NoSQL.  The  flexibility  of  a  DB  like  MongoDB   makes  it  easier.   •  Use  /**  @MongoDBPreLoad  */  from  the  Doctrine  ODM   •  No  miracle  solu0on…  YET!  J   12/10/2012   27   THEODO  
  • 28. Final  step:  cleaning  the  old  code   The  challenge  of  progressive  rewrite   12/10/2012   28   THEODO  
  • 29. The  need  for  progressive  rewrite     The  technical  challenges  faced     Theodo  Evolu=on   12/10/2012   29   THEODO  
  • 30. Theodo  Evolu=on   Our  strategy  with  progressive  rewrite     •  The  Theodo  team  consists  as  of  today  of  18  excellent  web  devs   •  Every  technical  solu0on  for  progressive  rewrite  in  Symfony2  is   bundled  in  Theodo  Evolu0on   •  Two  R&D  engineers  are  now  working  full-­‐0me  on  finding  new   solu0ons   •  Goal:  make  Theodo  Evolu0on  an  out-­‐of-­‐the-­‐box  solu0on       12/10/2012   30   THEODO  
  • 31. Questions ? fabriceb@theodo.fr @theodo www.theodo.fr 12/10/2012   31   THEODO