Paul Rouke Bio

I'm the user experience director at PRWD, and have 7 years commercial experience at Littlewoods Shop Direct. Delivering User Centered Design processes to improve systems and applications is what I do.

view my full bio

PRWD

Usability and software development agency specialising in:

  • User Centered Design
  • Best Practice E-commerce capability, UCDCommerce
  • Business Modernisation

view more on PRWD

PRWD, specialists in online user experience
Call us today on
0161 918 6729

Search

PHP Framework Comparison: Zend Framework

5 comments

I have recently been researching various PHP frameworks, for use in upcoming projects.  These projects are large-scale, enterprise PHP systems which are going to be developed and maintained over a long period of time, so making the right choice of framework is crucial.  Also important is the ease of development – how easy the different frameworks make application development, and how they support rapid development, prototyping and agile development processes.  This post is the first in a series comparing the strengths and weakness of PHP frameworks.

The first two frameworks I have considered are the Zend Framework (currently at version 1.5) and Symfony (version 1.0, though version 1.1 has just been released).  I have considered a number of different factors and my judgements are very much a subjective view.  I have had plenty of experience of different software libraries, from coding C++ using the Microsoft Foundation Classes library in the late 90s, to PHP using the Drupal CMS/F (whether one considers Drupal to be a ‘framework’ is a matter of debate) and Python using Django.  In this time I think that I have learned to spot the strengths and weaknesses of frameworks and libraries, so, although subjective, my views aren’t totally uneducated.

Zend Framework

The first thing to say about ZF is that it wasn’t what I expected.  Having used Django and observed the general trend in web frameworks towards code generation and advanced ORM, ZF was surprising in that it bucked this trend entirely.  If you want CRUD code with ZF, you can write it yourself.  This, in itself, is not necessarily a bad thing, but it is slightly discouraging when you just want to get in and have a play about it with the framework.  In this day and age, the ability to rapidly assemble a working prototype is very important, and ZF could go further in making this easy.

Features

After a while of using ZF, it becomes apparent that my initial objection – that it doesn’t really speed up development during the very early phase of a project – is an intentional design choice.  The ZF developers refer to this as ‘use-at-will’ architecture; in old-fashioned software engineering lingo, we might say that ZF is ‘loosely-coupled’, in that the various classes it provides can be used separately, without reference to the rest of the framework.  This makes ZF a great choice for refactoring legacy code, as you can just plug in those bits of the framework that you need, without having to modify anything else.  If all you really want is the (very useful) ZF Akismet class (which interfaces with Automattic’s Akismet service), you don’t need to use the rest of the library at all.

In fact, after a while I started to think that the aims of ZF are actually somewhat different to the aims of other frameworks.  Most other PHP frameworks were funded and contributed to by developers who needed the functionality in their day jobs.  CodeIgniter came from the development of ExpressionEngine, Fabien Potencier’s Sensio Labs created Symfony to power their in-house projects, Drupal was started by Dries Buytaert to provide a basic community website and forum and Ruby on Rails began life as a basic library of functions used by 37 Signals for the development of Basecamp.  The Zend Framework, on the other hand, was funded by Zend specifically to create a strong, reliable PHP framework in order to give PHP a rival to Rails and Django.  It is, in effect, an ‘immaculately conceived’ framework, designed from first principles to support the widest-possible deployment, rather than to solve specific common problems.

In this respect, ZF is more of a ‘library’ than a ‘framework’.  It provides a set of classes that you can use as you see fit, taking out the ones that interest you, and leaving the rest.  What it does not really do is provide you with the basic foundational structure of an app that most other web development frameworks tend to do these days.  This is probably due to Zend’s different motivations in creating ZF – they are not a bunch of deadline-driven web developers trying to make their own jobs easier by creating a framework to build new apps with; instead they are attempting to create a set of classes that others can use in a whole variety of different ways, many of which the ZF developers cannot anticipate.

As such, ZF represents something similar to the C++ Standard Template Library – the object-oriented successor of the older C Standard Library.  Zend appear to be trying to give developers a new set of modern, object-oriented tools with which to build applications, perhaps replacing some of the reliance on the huge legacy PHP feature set.

Documentation

ZF’s documentation is poor.  There’s a reasonably good reference for each class, but there are nowhere near enough example applications and tutorials.  This is probably related to the fact that ZF classes can be used in isolation from each other and there isn’t always a clear way of constructing a basic app to make use of these classes, but this is no excuse.  For a developer considering ZF for the first time, it can be hard to see exactly how one is meant to make use of it.  What examples there are tend to be quite complex and focus on the arcana of the framework’s implementation than practical use cases.  This is my single biggest problem with ZF.

Community

The genesis of ZF also contributes to the slightly odd feel of the community.  Coming from a Drupal background, I’m used to a very self-reliant community, with a strong ‘do it yourself’ approach to improving the software, the kind of ethos that, to me, signifies a truly great open source development.  The Zend Framework doesn’t have that yet.  Too often, the ‘community’ seems to consist of ‘users’ rather than ‘doers’, people who would rather petition Zend to improve the software than submit a patch or create a new module.  Open source projects, if they work well, are a bit like crowd-surfing at a gig – you throw yourself out there and hope that enough people decide to catch you.  At the moment, it’s not apparent that there are enough people to catch the Zend Framework, so it can’t make the leap.  The developers can’t quite let go of their creation, either because they are unwilling to, or because there’s not enough people there to catch it.  This does lead to some unfortunate examples of developers reacting personally to criticism, rather than the standard open source response of ‘fix it yourself if you don’t like it!’.

Conclusion

ZF’s strengths are clear – the code is well-written, covers a range of common web development tasks, including some areas neglected by other frameworks, and succeeds in making it easy for developers to incorporate ZF code into legacy projects.  These strengths alone make it an important piece of software that is likely to remain relevant for cutting-edge PHP developers over the next few years.  The framework’s weaknesses – that it isn’t really a framework – are easily addressable; it’s not hard to imagine someone creating the additional ‘glue’ that would make ZF a viable framework in the mould of Rails and Django.  If that code came from the community rather than Zend, then it would be a sign of ZF blossoming into a truly useful framework.  And if this could all be documented, we might be getting somewhere!

Part two of this post will consider the Symfony framework. Stay tuned!

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • del.icio.us
  • Facebook
  • Google
  • Furl
  • NewsVine
  • Reddit
  • StumbleUpon

Tags: , ,

Comments

  1. Wil Sinclair

    Wow. You seem to have nailed our philosophy and goals on the head. I often talk about ‘working up to simplicity’ as opposed to working down from simple use cases. We decided very early on that the only way we could provide the power and flexibility our users need with the simplicity they expect, we’d have to build on top of sound foundations while working toward the presto! application. We also realized that wasn’t all going to come together in a single release. It was a hard decision, since a lot of developers draw conclusions in the first hour of evaluating a framework, but we happen to think than many developers will find the hundreds or thousands of hours they invest in a framework somewhat more important. :)
    Let me be 100% clear about this: Zend, with the help of our contributors, will fill in the pieces to get to a great first-hour experience over the next few releases, but we love to see frameworks built on top of ZF. There are a few I’m aware of: Xyster, Zym, and the non-FOSS (yet ;) ) framework that the guys at tilllate.com have built. Undoubtedly there are more that I haven’t heard of or can’t remember right now. We are choosing a particular direction for project generation and manipulation that inevitably will not agree with some developers, so no one should be discouraged from creating and maintaining implementations that reflect their preferences. Of course, they can always help with ours, too. ;) Read more about it (in the Zend_Tool proposals) here: http://framework.zend.com/wiki/display/ZFPROP/Home.
    RE: Documentation. You know, this is a funny topic. Some people say it’s great, some say it’s terrible. I think our documentation appeals to certain developers and ramping up styles. Let me know any specifics of what would appeal to you. If the QuickStart helped form your poor impressions of ZF docs, I take full responsibility; I simply haven’t had the time to get back to it. :(
    RE: Community. Honestly, I wouldn’t expect this assessment. We have about 10-15 very active community contributors. There are far more doc- and translation-oriented contributors. I also think of issue creation, ZF blogging, and even petitions to Zend to fix stuff as contributions in their own manner. I believe we’d have more major contributors if we didn’t have a relatively intensive proposal process, but we feel this process is necessary to provide the consistency and quality of ZF components. Without the quality we would simply not be meeting our goals with the framework. What changes would you make to foster a more effective FOSS-style community?
    Could you please send me any links to any of our developers- including community members- that have taken criticism personally? While everyone has a bad day every now and then, we have talked about how we can make the most of any criticism. I think it’s valid to prompt the person who found the problem to also fix it; we want everyone to know that ZF is open for contributions, after all. This sentiment should always be sincere and encouraging; I will address any contributor directly if it is used to dismiss criticism. All that said, we do have a lot of users who do not contribute, and we value them as well.

    I wish you the best with whichever framework you end up going with.

    ,Wil



  2. Rob Knight

    Thanks for the comment Wil.

    Regarding the documentation, I think that it’s lacking in the tutorial/quickstart area, as you mention. The Quick Start tutorial seems to be the only decent example of how to build something in ZF, and it’s not really a great example. It shows some of the basic mechanics of ZF apps, but it’s not very engaging. It suffers greatly in comparison with Symfony’s Askeet Tutorial, which is a 24-step tutorial showing how to build a complete web app. That said, ZF’s reference documentation is slightly better than Symfony’s. Representing class libraries in reference format is always slightly complicated by the issue of dependencies between classes (due to the need to jump between different classes to read up on related topics, which isn’t so much of an issue in modular non-OO code libraries), so navigation is a bit clunky, but the documentation is good. To be honest, I’ve never seen reference documentation for OO systems done particularly well.

    The community is probably better than I give it credit for, but I’m coming from a background of having recently done some Drupal development (and I’d regard Drupal as a serious competitor to ZF for many web development tasks). The Drupal community is huge and extremely well-engaged. No PHP framework can match it, but some seem to be closer to getting that kind of community engagement than others. Perhaps it’s just a question of emphasis and origin; ZF still feels more like a cathedral than a bazaar (I know, the metaphor doesn’t quite fit) right now, but that may change. In an odd way, the very professional look-and-feel of the ZF site makes it feel less like a community project and more like a corporate exercise.

    Regarding developer attitudes, the post I linked to earlier sort-of illustrates this. OK, I admit that this isn’t quite as negative as I thought it was at first glance, but the general vibe from yourself and Matthew in that thread seems to be very much “we’ll implement that feature at some point in the future, maybe” and Matthew did seem a little bit offended at the criticism, but maybe I misread this. However, I do think that the best response there would have been “here’s the issue for this, go contribute some code if you think that this feature is so important”. The fact that you didn’t feel able to say this underlines my earlier point about “letting go” of the project. It’s not your job to defend the software when people are asking for extra features - it’s their job to implement it (or assist others who will do so). In retrospect I may have been a little harsh in seeing this as a failing on your part though; I’ve just become used to a rather uncompromising attitude towards ‘do it yourself’ open source project management!



  3. [...] post is the second in a series. The first post focussed on the strengths and weaknesses of the Zend Framework. This post about another leading PHP framework, [...]



  4. Wil Sinclair

    Thanks for the clarifications!
    The QuickStart is back under active development, and I think I’ve found a way to do it so that it remains succinct for the people who want to get going fast, yet informative for the people who want some more background. Stay tuned. I’ll try to remember to come back here and post a note once it’s done.
    Askeet is simply awesome and model of what all frameworks should aspire to in their tutorial apps. That said, we just haven’t found the time to do something similar at Zend. Fortunately, one of our community members has stepped up with an extended blog tutorial: http://blog.astrumfutura.com/index.php?/plugin/tag/tutorial. I’ll ping him about if/when he plans to finish it off and format the content in a more sequential and consolidated way.
    Self-referential links in the ref guide? Great idea! I’ll take a look at how to do this with docbook.
    RE: Community. I honestly don’t think this is an accurate description of our community. We are putting together 1.6 RC1 right now; much more than half of the code has been written by community members. Zend does try to bring a little order to the chaos with our Proposal Process and issue tracking workflow- certainly more so than many other OS projects- but we are very careful about remaining open to all and encouraging community contributions. Maybe you can drop by our contributor IRC channel to see how we roll. :) #zftalk.dev on freenode
    Did you see our site before the 1.5 release? Could be that we’ve just over-corrected a bit. ;) Seriously, tho, we don’t want to obscure the origins and intentions behind the project; the site is definitely geared towards selling developers and decision makers alike on ZF. I can see your point here but if the site changes significantly, it will only be to execute on this strategy more effectively. The site isn’t maintained by our marketing department, but I certainly take their advice when planning updates.
    Hmmmm. . . the post. It’s great getting back to things you’ve written a month ago, isn’t it? :) I don’t see any problem with what I wrote. But then again, it is my opinion after all. ;) I didn’t mention his doing it himself because we already had plans, and I didn’t want to encourage him to duplicate that effort. 1.6 RC1 is coming out next week, and it doesn’t include a file upload form element, after all. I believe I would have sincerely encouraged him to contribute otherwise.
    To be honest, I think Matthew was a bit sharp. In fact, this is the sharpest communication I think I’ve ever seen from him. I think it might have something to do with the ‘WTF?’ comment in the original post. We get a lot of criticism, as do all open source projects, and this particular criticism seems very well founded but could be read as disrespectful. To give the blogger credit, his update and replies seem much more constructive and respectful. And Matthew did address his points, albeit with a lot of underscores. :) I’d guess that Matthew and Al happened to catch each other in bad moods. If you find other posts where any ZF’er seems cross or dismissive or un-constructive, please let me know immediately. I think you’ll find by going through the ZF archives and searching for other blogs that we’ve both written and commented on that this is not characteristic at all of our communications. That said, if there is any way that we can improve on our communication with the community, we’re always looking for suggestions.



  5. [...] my earlier posts on Zend Framework and Symfony, the final part of my comparison will be an evaluation of [...]



Submit a Comment

(all fields are required)
You can use these XHTML tags:

<a href="" title=""> <abbr title=""> <acronym title="">
<b> <em> <i> <blockquote cite=""> <code> <strike> <strong>