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.

Denis Brumann

February 04, 2021
Tweet

More Decks by Denis Brumann

Other Decks in Programming

Transcript

  1. 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
  2. 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
  3. 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
  4. 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 • …
  5. 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
  6. 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
  7. Utility Features Components that can be used outside of Symfony,

    e.g. in libraries • Process • Finder • EventDispatcher
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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
  16. core features utility features easier to use harder to use

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

    use standalone application features framework features
  18. 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