What I Want from a Framework

While some are calling it vaporware, others have suggested wishlists of features for Zend’s recently announced PHP framework. Given how much I have been writing lately about best practices with PHP in the enterprise, I figured I’d chime in. Here’s my list:

  • Enforced separation and abstraction of business logic, data storage, and display
  • Facilitation of object and variable persistence in a secure fashion throughout a well-defined lifespan of the web application
  • Facilitaton of modular architecture for code reuse at the business logic level

It’s a short list, but, really, that’s all I want.

The logic/storage/display separation does not have to be model-view-controller. This approach as it currently lives and breathes within the discipline of computer science is heavily geared toward desktop applications that perform real-time GUI interactions. However, the Achilles heel of PHP remains the lack of enforcement of separation of code and content. For this reason, I would venture to guess nearly 50% of all PHP web applications currently available are virtually unmaintainable by enterprise standards. This first point alone could stop the spaghetti code factory cold.

The second point is something that other architectures have been doing well for some time, but at the expense of a degree of flexibility. PHP’s sessions mechanism is reasonably lightweight (from a design perspective) and highly functional. But as we have seen in the bulk of session security literature, there are some major shortcomings as well. A more functional variable (and object) persistence model would help PHP make the leap from its humble origins as Personal Home Page to an even more powerful application architecture.

Finally, abstraction from the display layer should facilitate reusable business logic components that can be applied in a variety of fashions–not just HTML. For example, using AJAX-like component we should be able to quickly and easily enforce the same variable checking on the client side using JavaScript as we enforce on the server side with PHP. Furthermore, such logic should be modular and interchangeable at various stages of the execution of the application.

Give me these three, and you can keep all the fancier (and heavier) facets of other enterprise application frameworks. After all, a framework is designed to support and uplift–not encumber. Keep it simple, Zend–and elegant. Or it may end up so much heavier than vapor that it falls to the floor and stays there.