Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Cartographing Symfony

Cartographing Symfony

This talk takes a look at Symfony Components from a package design perspective. We first categorize the components in functional layers and then take a closer look at how those layers are used by analyzing the package dependents. From there we take a look at package design principles and how they affect both the packages itself and their documentation and finally we discuss common questions around Symfony components.

6a1345d8e6dd15b2c78eff0c331963b1?s=128

Denis Brumann

February 04, 2021
Tweet

Transcript

  1. Cartographing Symfony Making sense of the Symfony Components when used

    standalone or in full-stack
  2. None
  3. Symfony 2.0 Full List of Components BrowserKit ClassLoader Config Console

    CssSelector DependencyInjection DomCrawler EventDispatcher Filesystem Finder Form HttpFoundation HttpKernel Locale Process Routing Security Serializer Templating Translation Validator Yaml 22 components
  4. Symfony 5.2 Full List of Components Asset BrowserKit Cache Config

    Console CssSelector DependencyInjection DomCrawler Dotenv ErrorHandler EventDispatcher ExpressionLanguage Filesystem Finder Form HttpClient HttpFoundation HttpKernel Inflector Intl Ldap Lock Mailer Messenger Mime Notifier OptionsResolver Process PropertyAccess PropertyInfo RateLimiter Routing Security Semaphore Serializer Stopwatch String Templating Translation Uid Validator VarDumper VarExporter WebLink Workflow Yaml 26 NEW components
 *compared to Symfony 2.0
  5. core features utility features application features framework features

  6. 74.336 Dependents Overall

  7. Core Features Asset BrowserKit Cache Config CssSelector DependencyInjection DomCrawler Console

    ErrorHandler EventDispatcher ExpressionLanguage Filesystem DotEnv Form HttpClient HttpFoundation Inflector Intl Ldap HttpKernel Mailer Messenger Mime Notifier Lock Finder Process PropertyAccess PropertyInfo Routing Security Semaphore RateLimiter Stopwatch String Templating Translation Serializer OptionsResolver VarExporter Weblink Workflow VarDumper Uid Validator Yaml
  8. Core Features Improve on core PHP functionality • HttpFoundation provides

    OOP on top of superglobals • String provides clear API around mb_* and other string functions • Uid provides OOP for handling UUID/ULID-strings • VarExport works around limitations of clone • …
  9. Core Features Asset BrowserKit Cache Config CssSelector DependencyInjection DomCrawler Console

    ErrorHandler EventDispatcher ExpressionLanguage Filesystem DotEnv Form HttpClient HttpFoundation Inflector Intl Ldap HttpKernel Mailer Messenger Mime Notifier Lock Finder Process PropertyAccess PropertyInfo Routing Security Semaphore RateLimiter Stopwatch String Templating Translation Serializer OptionsResolver VarExporter Weblink Workflow VarDumper Uid Validator Yaml
  10. Core Features Filesystem

  11. 12.187 Dependents on Core Features

  12. None
  13. None
  14. Utility Features Asset BrowserKit Cache Config CssSelector DependencyInjection DomCrawler Console

    ErrorHandler EventDispatcher ExpressionLanguage Filesystem DotEnv Form HttpClient HttpFoundation Inflector Intl Ldap HttpKernel Mailer Messenger Mime Notifier Lock Finder Process PropertyAccess PropertyInfo Routing Security Semaphore RateLimiter Stopwatch String Templating Translation Serializer OptionsResolver VarExporter Weblink Workflow VarDumper Uid Validator Yaml
  15. Utility Features Components that can be used outside of Symfony,

    e.g. in libraries • Process • Finder • EventDispatcher
  16. Utility Features Asset BrowserKit Cache Config CssSelector DependencyInjection DomCrawler Console

    ErrorHandler EventDispatcher ExpressionLanguage Filesystem DotEnv Form HttpClient HttpFoundation Inflector Intl Ldap HttpKernel Mailer Messenger Mime Notifier Lock Finder Process PropertyAccess PropertyInfo Routing Security Semaphore RateLimiter Stopwatch String Templating Translation Serializer OptionsResolver VarExporter Weblink Yaml VarDumper Uid Validator Workflow
  17. Utility Features Finder

  18. Utility Features Finder

  19. 37.240 Dependents on Utility Features

  20. None
  21. Application Features Asset BrowserKit Cache Config CssSelector DependencyInjection DomCrawler Console

    ErrorHandler EventDispatcher ExpressionLanguage Filesystem DotEnv Form HttpClient HttpFoundation Inflector Intl Ldap HttpKernel Mailer Messenger Mime Notifier Lock Finder Process PropertyAccess PropertyInfo Routing Security Semaphore RateLimiter Stopwatch String Templating Translation Serializer OptionsResolver VarExporter Weblink Yaml VarDumper Uid Validator Workflow
  22. Application Features Application components, that usually work on top of

    the framework, core or utility features • Messenger supports Mailer optionally uses Serializer • Form relies on Validation (optionally), HttpFoundation and OptionResolver
  23. Application Features Asset BrowserKit Cache Config CssSelector DependencyInjection DomCrawler Console

    ErrorHandler EventDispatcher ExpressionLanguage Filesystem DotEnv Form HttpClient HttpFoundation Inflector Intl Ldap HttpKernel Mailer Messenger Mime Notifier Lock Finder Process PropertyAccess PropertyInfo Routing Security Semaphore RateLimiter Stopwatch String Templating Translation Serializer OptionsResolver VarExporter Weblink Yaml VarDumper Uid Validator Workflow
  24. Application Features Messenger

  25. 9.627 Dependents on Application Features

  26. None
  27. Framework Features Asset BrowserKit Cache Config CssSelector DependencyInjection DomCrawler Console

    ErrorHandler EventDispatcher ExpressionLanguage Filesystem DotEnv Form HttpClient HttpFoundation Inflector Intl Ldap HttpKernel Mailer Messenger Mime Notifier Lock Finder Process PropertyAccess PropertyInfo Routing Security Semaphore RateLimiter Stopwatch String Templating Translation Serializer OptionsResolver VarExporter Weblink Yaml VarDumper Uid Validator Workflow
  28. Framework Features Components that primarily build up Symfony as an

    application framework • HttpKernel ties config, routing, error handling for web app together • Config loads human processable config files and validates them • DependencyInjection takes config and creates PHP service configuration • Routing provides a way to determine which Controller should be used • ErrorHandler centralizes & streamlines error-/exception-handling • Templating renders output for Response
  29. Framework Features Asset BrowserKit Cache Config CssSelector DependencyInjection DomCrawler Console

    ErrorHandler EventDispatcher ExpressionLanguage Filesystem DotEnv Form HttpClient HttpFoundation Inflector Intl Ldap HttpKernel Mailer Messenger Mime Notifier Lock Finder Process PropertyAccess PropertyInfo Routing Security Semaphore RateLimiter Stopwatch String Templating Translation Serializer OptionsResolver VarExporter Weblink Yaml VarDumper Uid Validator Workflow
  30. Framework Features DependencyInjection

  31. 15.282 Dependents on Framework Features * * Symfony Bundles

  32. None
  33. None
  34. Framework Features Asset BrowserKit Cache Config CssSelector DependencyInjection DomCrawler Console

    ErrorHandler EventDispatcher ExpressionLanguage Filesystem DotEnv Form HttpClient HttpFoundation Inflector Intl Ldap HttpKernel Mailer Messenger Mime Notifier Lock Finder Process PropertyAccess PropertyInfo Routing Security Semaphore RateLimiter Stopwatch String Templating Translation Serializer OptionsResolver VarExporter Weblink Yaml VarDumper Uid Validator Workflow
  35. core features utility features application features framework features less coupled

    more coupled
  36. core features utility features easier to use harder to use

    application features framework features
  37. core features utility features easier to use standalone harder to

    use standalone application features framework features
  38. None
  39. None
  40. None
  41. Symfony 2.8 • Assets • ExpressionLanguage • Intl • Ldap

    • OptionsResolver • PropertyInfo
  42. Symfony 3.4 • Cache • DotEnv • Inflector • WebLink

    • Workflow
  43. Symfony 4.4 • ErrorHandler • HttpClient • Messenger • Mime

    • Notifier • VarExporter
  44. Symfony 5.2 • RateLimiter • Semaphore • String • Uid

  45. https://matthiasnoback.nl/book/principles-of-package-design/

  46. The Release/Reuse Equivalence Principle The Common Reuse Principle The Common

    Closure Principle The Acyclic Dependencies Principle The Stable Dependencies Principle The Stable Abstractions Principle
  47. ISO/IEC 25010

  48. None
  49. Decoupled?! Using Symfony Components standalone is really difficult!

  50. None
  51. None
  52. None
  53. None
  54. None
  55. None
  56. None
  57. None
  58. None
  59. None
  60. None
  61. None
  62. None
  63. None
  64. NIH Why doesn’t Symfony just reuse existing libraries?

  65. None
  66. None
  67. None
  68. Where is Waldo? Why doesn’t Symfony have feature X, Y

    or Z?
  69. None
  70. None