Thoughts on Zend Framework

I’ve been trying out a few frameworks recently for a couple of projects, and this week I’ve been playing around with Zend Framework. These are my thoughts from having gone through the quick start tutorial.

Firstly, there seems to be a huge amount of repeated code. For example, you define the fields for a model in up to four places:

  1. The model file itself, as instance variables.
  2. The mapper model, when fetching and saving data.
  3. The schema file.
  4. Every form class – assuming you want to be able to add/edit data.

Given that a framework is supposed to save time, I’d expect one of the following options:

  1. Define the model in the schema file, and generate the models and forms from that.
  2. Define the model once and generate the mapper, forms and schema from that.
  3. Have the models and forms automatically work out the fields by running a ‘SELECT * FROM model_table’  query.

Having the model defined in four places makes it highly likely that developers will forget to update one of the definitions, resulting in an inconsistent state across the application.

Secondly, there are mistakes in the tutorial. The most glaring of these is that the example PHP files shown do not start with ‘<?php’, which means that the interpreter will output them as text, rather than executing them as PHP. Overall, it feels as if the tutorial was written once then never updated, which is a shame.

Finally, there is the Contributor Licence Agreement, which you have to sign before you can contribute any code or documentation to the project. I’m in two minds about this, on the one hand I can see how it might protect the project from copyright infringement claims, but on the other hand there’s no guarantee that the CLAs are checked properly or that the people signing them are telling the truth.

On the bright side, I did find Zend easy to use and deploy, plus it has a fantastic set of libraries which you can use with or without the framework. I still need to play around with the form building tools before coming to a final decision, but so far it is a contender, and higher up than Symfony at the moment.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.