Initial Thoughts on the Zend Framework

Jan 9, 10:54 am

I’ve been using the Zend Framework to recode a large website and I’ve generally been very pleased with the results and ease of use. I’ve found that using the framework has significantly decreased my development time and really just given me cleaner, easier to maintain code. Of course, these are the goals of any framework. I do have a couple of issues I’ve come across and it is those I’d like to talk about.

As a disclaimer, I do realize that the Zend Framework is still in beta and is still apt to change. That’s one of my goals with this post…to help bring about change in a couple areas I see need it.

The first annoyance I came across was that I am unable to use Zend_Db_Table with some of my tables because I don’t have a single column primary key. I don’t want to engage in debate here on whether or not a primary key should include multiple columns. That’s not the point. Personally I believe there are are valid uses, but again that’s not the point :). The point is that there are people with tables that have multi-column primary keys and Zend_Db_Table should work with those tables. In my situation I’ve had to resort to either altering the table and adding a autoincrementing primary key or just issuing direct SQL queries. I’d prefer to leave my table definition alone and utilize Zend_Db_Table throughout my application rather than a mixture of SQL access methods.

The second annoyance I’ve seen is that I can’t set unique lifetimes for different Zend_Cache objects. This is a serious, serious issue that needs to be addressed. Just about any application that caches multiple objects can benefit from different lifetimes. I’ve had to resort to checking the filetime on the cache file and manually expiring it. That’s an ugly hack that I would rather not do.

Those are really my only two complaints at this point. I’d love a tighter integration of the Model, but I can live with the way it is implemented now. I’ve enforced on myself some strict rules for dealing with the Model and I can deal with that. So, my hats of to the development team! Keep up the good work!


    1. doctorrock says:

      yeah I had the same problem : table with a 2 colomn primary key. And I prefered the same solution as you : add an id column to be able to use Zend_Db_Table.


    1. Joshua says:

      I haven’t worked that much with ZF nor moved my application but I have many tables with multi-keys so this is an issue for me as well. If/When I make the move I’m guessing the approach I would take is to write a class that extends Zend_db_table to provide multi-key support. Would this not make more sense then modifying the schema? Thanks for the overview ;)



    1. Hi, this is Bill Karwin, Product Engineering Manager for the Zend Framework. I thank you for your feedback!

      Yes, resolving the issue of supporting compound keys and natural keys is a high priority for me. I intend to fix that issue and many others in Zend_Db before we release Zend Framework 1.0.

      Your issue with configuring different lifetimes in Zend_Cache for different cached objects is a good suggestion. I’ll log this as a feature request in our issue tracker. We’ll try to find a solution for this.



    1. FYI:

      “Add ability to specify the lifetime of individual cache entries”
      http://framework.zend.com/issues/browse/ZF-457

      “Support multi-column primary keys in Zend_Db_Table”
      http://framework.zend.com/issues/browse/ZF-37

      “Zend_Db_Table_Row: Allowing setting primary key value when creating record”
      http://framework.zend.com/issues/browse/ZF-191



    1. Bill…thanks for your feedback. It’s great to know you guys are keeping an eye on the pulse of the community.




Add your comments

Please keep your comments relevant to this blog entry: inappropriate or purely promotional comments may be removed. To add hyperlink, please follow this example: "your link text":http://your.link.url