Posted by & filed under PHP.

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.

2 Responses to “What I Want from a Framework”

  1. Max

    Green Orange is a community of developers who love PHP. We are currently developing an exciting project called Green Orange Framework.

    GOF (Green Orange Framework) was born from an idea to use a browser as a development environment to build stand-alone applications for the web.

    Web projects are built using PHP programming language incorporating a complete collection of classes, organized in levels and families (packages).

    Green Orange allows you to code sites using OOP practices.

    Further, Green Orange is the first PHP development environment that uses a graphic user interface (GUI) to easily and quickly build a site within your browser.

    The framework and the whole visual development environment is licensed under GPL, therefore it completely free.

    Our framework is your framework so we invite you to use it, spread it, expand it, and to report every possible bug to us, with the goal to improve and share it with the whole community when it is completed.

    Come and join us…

    http://www.greenorange.org

  2. Robert

    Thanks, Max. Looks like not only an oo framework but a kind of CMS/IDE as well with graphical tools. I must admit, though, that when I heard the name, I thought to myself, “A green orange is one that is not quite ripe yet.” Maybe time to rethink the brand? ;)