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

Decoupling Packages From Your Framework

Adam Wathan
November 08, 2014

Decoupling Packages From Your Framework

It's really fun to build a package that adds some awesome functionality to your favourite framework. If you're not careful however, you can end up releasing something that nobody could use outside of Framework-X no matter how hard they try.

In this talk, I'll walkthrough building a framework agnostic package. You'll learn about important OO design principles like dependency injection, interfaces, and encapsulation, and see how we can integrate our package with a modern framework like Laravel, or the messiest legacy codebase you've ever seen.

Adam Wathan

November 08, 2014
Tweet

More Decks by Adam Wathan

Other Decks in Programming

Transcript

  1. @ADAMWATHAN ▸ Software developer ▸ Host of Full Stack Radio

    ▸ Former Audio engineer ▸ Competitive powerlifter
  2. @ADAMWATHAN ▸ Software developer ▸ Host of Full Stack Radio

    ▸ Former Audio engineer ▸ Competitive powerlifter ▸ ...Batman?
  3. Dependency injection is a software design pattern that implements inversion

    of control and allows a program design to follow the dependency inversion principle. 1 1 http://en.wikipedia.org/wiki/Dependency_injection
  4. INTERFACES 101 ▸ Like a contract ▸ Describes public API

    of a role ▸ Does not provide any implementation
  5. INTERFACES 101 ▸ Like a contract ▸ Describes public API

    of a role ▸ Does not provide any implementation ▸ Great as documentation in a package
  6. YOU DON'T HAVE TO SUPPORT EVERY FRAMEWORK OUT OF THE

    BOX... JUST DON'T GET IN THE WAY.