SlideShare uma empresa Scribd logo
1 de 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	
  

Mais conteúdo relacionado

Semelhante a 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
 

Semelhante a 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
 

Último

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 

Último (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 

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