How PrestaShop started the migration to Symfony

How PrestaShop started the migration to Symfony

My small talk for the Symfony Catalunya 2016 event where I've showed how PrestaShop started the migration to Symfony with some easy steps.

6e25e7d18b4bddc1d3bfef8bbc171773?s=128

Julien Martin

July 23, 2016
Tweet

Transcript

  1. Symfony Catalunya 2016 How PrestaShop started the migration to Symfony

    Symfony Catalunya 2016
  2. Symfony Catalunya 2016 How PrestaShop started the migration to Symfony

    Symfony Catalunya 2016
  3. Symfony Catalunya 2016 Overview of PrestaShop

  4. Symfony Catalunya 2016 What is PrestaShop?

  5. Symfony Catalunya 2016 What is PrestaShop? • Open source e-commerce

    solution
  6. Symfony Catalunya 2016 What is PrestaShop? • Open source e-commerce

    solution • Project started in 2007
  7. Symfony Catalunya 2016 What is PrestaShop? • Open source e-commerce

    solution • Project started in 2007 • Used by 250,000 shops worldwide
  8. Symfony Catalunya 2016 What is PrestaShop? • Open source e-commerce

    solution • Project started in 2007 • Used by 250,000 shops worldwide • Available in 60 different languages
  9. Symfony Catalunya 2016 What is PrestaShop? • Open source e-commerce

    solution • Project started in 2007 • Used by 250,000 shops worldwide • Available in 60 different languages • More than 600 features by default
  10. Symfony Catalunya 2016 What is PrestaShop? • Open source e-commerce

    solution • Project started in 2007 • Used by 250,000 shops worldwide • Available in 60 different languages • More than 600 features by default • 3,500 modules available on the marketplace
  11. Symfony Catalunya 2016 What is PrestaShop? • Open source e-commerce

    solution • Project started in 2007 • Used by 250,000 shops worldwide • Available in 60 different languages • More than 600 features by default • 3,500 modules available on the marketplace • 2,000 themes
  12. Symfony Catalunya 2016 What is PrestaShop? • 40,000 lines of

    code for templates
  13. Symfony Catalunya 2016 What is PrestaShop? • 40,000 lines of

    code for templates • 30,000 lines of code for javascript
  14. Symfony Catalunya 2016 What is PrestaShop? • 40,000 lines of

    code for templates • 30,000 lines of code for javascript • 230,000 lines of code for PHP
  15. Symfony Catalunya 2016 Why did we migrate to Symfony?

  16. Symfony Catalunya 2016 Why did we migrate to Symfony? •

    Maintaining our framework costs time
  17. Symfony Catalunya 2016 Why did we migrate to Symfony? •

    Maintaining our framework costs time • This is not our job!
  18. Symfony Catalunya 2016 Why did we migrate to Symfony? •

    Maintaining our framework costs time • This is not our job! • We must focus on the e-commerce
  19. Symfony Catalunya 2016 Why did we migrate to Symfony? •

    Maintaining our framework costs time • This is not our job! • We must focus on the e-commerce • The reputation & the community
  20. Symfony Catalunya 2016 Why did we migrate to Symfony?

  21. Symfony Catalunya 2016 Why did we migrate to Symfony? Why

    not a PrestaShop v2?
  22. Symfony Catalunya 2016 Why did we migrate to Symfony? Why

    not a PrestaShop v2? • Re-creating the 600 features will take too much time
  23. Symfony Catalunya 2016 Why did we migrate to Symfony? Why

    not a PrestaShop v2? • Re-creating the 600 features will take too much time • We don’t want to break themes & modules compatibility
  24. Symfony Catalunya 2016 Why did we migrate to Symfony? Why

    not a PrestaShop v2? • Re-creating the 600 features will take too much time • We don’t want to break themes & modules compatibility • We cannot stop our business for years!
  25. Symfony Catalunya 2016 The migration!

  26. Symfony Catalunya 2016 Step #1 Allow Symfony to handle the

    requests
  27. Symfony Catalunya 2016 Allow Symfony to handle the requests

  28. Symfony Catalunya 2016 Allow Symfony to handle the requests

  29. Symfony Catalunya 2016 Allow Symfony to handle the requests

  30. Symfony Catalunya 2016 Allow Symfony to handle the requests From

    the Symfony API documentation:
  31. Symfony Catalunya 2016 Allow Symfony to handle the requests

  32. Symfony Catalunya 2016 Allow Symfony to handle the requests

  33. Symfony Catalunya 2016 Step #2 Learn the Adapter design pattern

  34. Symfony Catalunya 2016 Learn the Adapter design pattern What is

    an Adapter?
  35. Symfony Catalunya 2016 Learn the Adapter design pattern What is

    an Adapter? The adapter pattern allows the interface of an existing class to be used as another interface.
  36. Symfony Catalunya 2016 Learn the Adapter design pattern Price ________________

    +getProductPrice() Legacy sources Product ________________ +getBasePrice()
  37. Symfony Catalunya 2016 Learn the Adapter design pattern Product ________________

    +getPrice() Symfony AppBundle Price ________________ +getProductPrice() Legacy sources Product ________________ +getBasePrice()
  38. Symfony Catalunya 2016 Learn the Adapter design pattern Product ________________

    +getPrice() Symfony AppBundle Price ________________ +getProductPrice() Legacy sources Product ________________ +getBasePrice() ProductAdapter ________________ +getPrice() Adapters
  39. Symfony Catalunya 2016 Learn the Adapter design pattern Product ________________

    +getPrice() Symfony AppBundle Price ________________ +getProductPrice() Legacy sources Product ________________ +getBasePrice() ProductAdapter ________________ +getPrice() Adapters
  40. Symfony Catalunya 2016 Learn the Adapter design pattern Product ________________

    +getPrice() Symfony AppBundle Price ________________ +getProductPrice() Legacy sources Product ________________ +getBasePrice() ProductAdapter ________________ +getPrice() Adapters
  41. Symfony Catalunya 2016 Learn the Adapter design pattern

  42. Symfony Catalunya 2016 Learn the Adapter design pattern

  43. Symfony Catalunya 2016 Step #3 Overriding a service with an

    adapter
  44. Symfony Catalunya 2016 Overriding a service with an adapter •

    Custom translation system
  45. Symfony Catalunya 2016 Overriding a service with an adapter •

    Custom translation system • Start to use the Symfony Translator …
  46. Symfony Catalunya 2016 Overriding a service with an adapter •

    Custom translation system • Start to use the Symfony Translator … • … to remove the old one
  47. Symfony Catalunya 2016 Overriding a service with an adapter Legacy

    sources Adapters Symfony AppBundle Extends Use
  48. Symfony Catalunya 2016 Overriding a service with an adapter Legacy

    sources Adapters Symfony AppBundle Extends Use Register services
  49. Symfony Catalunya 2016 Overriding a service with an adapter

  50. Symfony Catalunya 2016 Overriding a service with an adapter

  51. Symfony Catalunya 2016 Overriding a service with an adapter

  52. Symfony Catalunya 2016 Overriding a service with an adapter

  53. Symfony Catalunya 2016 Overriding a service with an adapter

  54. Symfony Catalunya 2016 Overriding a service with an adapter

  55. Symfony Catalunya 2016 Step #4 Understand the 3 steps architecture

  56. Symfony Catalunya 2016 Understand the 3 steps architecture

  57. Symfony Catalunya 2016 Understand the 3 steps architecture Symfony AppBundle

  58. Symfony Catalunya 2016 Understand the 3 steps architecture Legacy sources

    Symfony AppBundle
  59. Symfony Catalunya 2016 Understand the 3 steps architecture Legacy sources

    Symfony AppBundle Adapters
  60. Symfony Catalunya 2016 Understand the 3 steps architecture Legacy sources

    Symfony AppBundle Will be removed Adapters
  61. Symfony Catalunya 2016 Understand the 3 steps architecture Legacy sources

    Symfony AppBundle Will be removed Use The legacy sources and the adapters can use and be dependent of any sources. Use Use Adapters
  62. Symfony Catalunya 2016 Understand the 3 steps architecture Legacy sources

    Symfony AppBundle Will be removed Extends Register Services The symfony sources will never directly use an adapter or a legacy source. Use The legacy sources and the adapters can use and be dependent of any sources. Use Use Adapters
  63. Symfony Catalunya 2016 There is still much to do!

  64. Symfony Catalunya 2016 There is still much to do! •

    From your template engine to Twig
  65. Symfony Catalunya 2016 There is still much to do! •

    From your template engine to Twig • Unit testing!!!
  66. Symfony Catalunya 2016 There is still much to do! •

    From your template engine to Twig • Unit testing!!! • Double database writing
  67. Symfony Catalunya 2016 There is still much to do! •

    From your template engine to Twig • Unit testing!!! • Double database writing • Rethink your processes
  68. Symfony Catalunya 2016 There is still much to do! •

    From your template engine to Twig • Unit testing!!! • Double database writing • Rethink your processes • Why not an API?
  69. Symfony Catalunya 2016 Julien Martin @shudrum Shudrum We’re Hiring! julien.martin@prestashop.com