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

Writing Extensible Applications

Writing Extensible Applications

How to make your application extensible using modular design, event-driven architecture and by providing extensions.

Andrey Yatsenco

February 12, 2016
Tweet

More Decks by Andrey Yatsenco

Other Decks in Programming

Transcript

  1. Presentation title here About me about me… Andrey Yatsenco •

    PHP Developer at Oro Inc. • 3 years with Symfony • 6 years with PHP https://www.facebook.com/yatsenco https://github.com/anyt
  2. Presentation title here When applications should be extensible? When you

    write: • a lot of similar apps • requirements change a lot • a lot of features in one app • open-source
  3. Presentation title here provide for change (enhancements) • while minimizing

    impact to existing system functions. • is a design principle where the implementation takes future growth into consideration. • extensions can be through the addition of new functionality or through modification of existing functionality Extensibility
  4. Presentation title here Typical problems of not extensible apps •

    Difficult to replace part of an app • Difficult to scale an application
  5. Presentation title here Common solutions • Abstractions and DI •

    Modular design • Extensions provider • Event-driven architecture
  6. Presentation title here Common solutions • Abstractions and DI •

    Modular design • Extensions provider • Event-driven architecture
  7. Presentation title here Common solutions • Abstractions and DI •

    Modular design • Extensions provider • Event-driven architecture
  8. Presentation title here Modular design Examples: • Symfony • ZF

    • Yii • Drupal • Joomla • Wordpress • etc. Naming: • modules • bundles • packages • plugins • service providers • etc.
  9. Presentation title here Modular design Separating the functionality of a

    program into independent, interchangeable modules, such that each contains everything necessary to execute only one aspect of the desired functionality.
  10. Presentation title here Modular design Bad practices: How to avoid

    this? • Event-driven architecture • Providing extensions
  11. Presentation title here What Symfony offers? Service container • Overriding

    classes of services with the same dependencies with parameters
  12. Presentation title here What Symfony offers? Service container • Overriding

    services in compiler passes with the same interface or by extending the original one in Compiler Passes
  13. Presentation title here What Symfony offers? You still can provide

    extension. There is no out of the box solution, because you don’t need it. You can check examples: • Twig • Form
  14. Presentation title here Conclusion • Extensions helps you to make

    addition and modification of your application while minimizing impact to existing functionality.
  15. Presentation title here Conclusion Common solutions • Abstractions and DI

    • Modular design • Extensions provider • Event-driven architecture
  16. Presentation title here P.S. Ideal OO code not the answer,

    because of performance. You can scale your infrastructure, because it's cheaper than development in some situations but usually not for a long time.
  17. Presentation title here References • The Philosophy of Extensible Software

    • Github - PHP Design Patterns • Wikipedia - Extensibility • Wikipedia - List of software development philosophies • Wikipedia - SOLID • SO - Designing extensible software • Java Docs - Creating Extensible Applications • Symfony Books