Zend Framework 0.6.0, yet an other preview

The Zend Framework has a strict roadmap. Releases arrive exactly as planned. Mid-December, 0.6.0 was released. I had to wait a few days before looking into it, but I took some time. The first thing I had in mind was to get my sample application to run with the new version. For the MVC aspect, not much changed since 0.2.0, except that the new stuff is now out of the incubator. The Zend_Controller_Front is now a singleton again, as it was in 0.1.0 and the patch with setRequest() is no longer required. On that front, the release is a good one. On the other hand, getting the ACL code to work was not as easy, but that was to be expected as it was never marked as stable. They went through some serious refactoring. One positive aspect: they got rid of the ARO and ACO acronyms and decided to use Role and Resource, which makes the whole thing more readable. The downside is that they broke everything I liked about it.

From a flexible tool you could play around with and extend on the fly, it became a rock solid Java-like structure. You can no longer create resources on the way that simply extend the parent one. The fluent interface using the __get() magic methods is gone. Worst of all, you actually have to create instances yourself and build the tree manually. Resource names are now global-like, so there is no way to use the same word twice in a different context. I did not do any extensive testing before, so maybe it was not possible altogether, but now they made it obvious.

Seriously, if I am to give a name to something, and be able to use that name afterwards, why would I even care about the class name used internally? Having to write Zend_Acl_Resource and Zend_Acl_Role is simply annoying since there is no value to the instance it creates. Check out the samples from the documentation.

  1. Introduction
  2. Refining
  3. Advanced

Hopefully, they will refactor this one again before the final release scheduled for May.

Of course, there are a lot of good aspects to the new release. Overall, I noticed a great improvement on the documentation. Improving the documentation is still part of the roadmap, but what is available already is more than anything I’ve seen for a class library. The framework is not even in a final release stage and translations are already in progress. Other than English, 10 translations are available (most of them partial so far, but still impressive).

Classes for authentication and session handling are also added. The only adapter available at the moment is Digest, but I can imagine more coming in the future, like LDAP and other ‘standard’ protocols. Of course, you can create your own adapters. I don’t really get the point of the session handling classes, but they appear to offer additional features like namespaces for values and offer some options to simplify session security.

The class I find the most interesting definitely is the Zend_Measure one. It was available in the last release, but no documentation was available at the time other than the API documentation, and that does not really tell you what it’s all about. Over a year ago, I had to perform unit conversions in order to translate values in technical publications. At that time, I searched around to find a library that could handle the conversion for me. Not that multiplications are hard, it’s just that I hate having to type in the conversion factors. I couldn’t find anything, so I had to type in the conversion factors. Most of it was a hack. I had no intention of releasing it in any kind of way. Now I see this package coming. What it does is simply amazing. Not only it does the conversions for a gazillion types of units, but it will find the units to convert in strings and handle the locales.

I still need to apply these in a real world context to see how good it really is, but it all looks very promising.

Leave a Reply

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