The Decoupling Doctrine: Taking Abstraction Too Far

I feel using a framework is like buying the pre-built tool kit to repair your car. It has a lot in it, but probably not everything you actually need, depending on the job.

I also think the good frameworks like Symfony are realizing the “framework lock-in” is a bad thing and are doing their best to break down the framework into clear components. Case in example, a quote from Fabien Potencier:

Symfony 3.0 is more decoupled and more reusable than ever (the HttpKernel is going to be split into several smaller ones – the profiler for instance will be standalone; classes are moved from bundles to components; components are extracted from existing ones, …)

So, I don’t think devs should be worrying so much about making framework agnostic code. Rather, I think the frameworks should be worried about reducing the “tentacles” they cause to as few as possible, if not, to none at all.

Other than that, I went searching for other opinions on framework agnostic code.

http://desmart.com/blog/dont-hard-code-yourself
http://www.phpbuilder.com/articles/application-architecture/optimization/creating-framework-agnostic-php-packages.html
http://php-and-symfony.matthiasnoback.nl/2014/06/how-to-create-framework-independent-controllers/

Scott

1 Like