Amazium bvba, your online partner
Book Reviewed : ZF 1.8 Web Application Development
  • Share post with Twitter
  • Share post with StumbleUpon
  • Share post with Delicious
  • Share post with Digg
  • Share post with Technorati
  • Share post with Blinklist
2010-02-26 11:04

Book Reviewed : ZF 1.8 Web Application Development

book review, zend framework, mvc

I am currently reviewing the book Zend Framework 1.8 : Web Application Development from Keith Pope. Expect more in a few weeks.

A bit more about the book

I just got a copy of the book Zend Framework 1.8 : Web Application Development from PACKT Publishing to do a review. Reading the information on the cover/packt website it looks promising. I will post a full review here around march 15th.

In his book, Keith Pope takes you trough the process of building Model-View-Controller-based web applications with Zend Framework. It's an example driven tutorial with a storefront application as end-point. Along the way, he covers common mistakes and best practices.

By the looks of it, the book is targeted for people new to Zend Framework, preferably with experience in OO. I'm interested to see what someone with experience in the technology can learn from it and test the line "you will learn how to use it in the best way and produce better applications".

What did I think of it?

The past two months I have been very busy with a project for one of my clients. So when I got the ebook from PACKT, I struggled with finding time to read it. Since I don't have an ebook reader like Kindle, IPad or anything else to carry the ebook around, it was a challenge to get around to reading it. So, I'm sorry it took two more weeks than expected to write down this review.

Since there are already quite a few reviews of the book out there, I decided to focus my review on matters that I am most interested in myself: the architecture of your application (Models, Services, etc), modular applications and performance.

Models

What I absolutely hate are the example on the net where the model equals the database objects. This is no good mojo! The author of the book starts off by advocating thin controller / fat model (good!) and then explains 3 kinds of models: direct inheritance (dbtable extended), has-a relationship / composite (reference to dbtable) and domain model. He clearly states the advantages and disadvantages of the first two and gives short examples. For the domain models (which I would have been most interested in) he gives an explanation of what it is about and then he lists a few reading references.

All in all the model chapter took less than 20 pages and -since it's one of the most overlooked bits of application design in Zend Framework- I would have liked to see more.

Modular applications

The author used modules in his architecture. In the Modules Roundup chapter he explains how to set up the application, how to load the necessary classes, how to add your own resource dir, etc... he also explains how the process of loading the bootstraps works (which gave some insights I didn't know about !).

He continues to explain how he proposes communications between 2 modules: Services! Ok, he had my attention when I started reading that. It's one of the things I have been messing around with a lot the past months, but I didn't find a satisfying solution yet. Basically all communication from within a module to a model in another module, must go trough the latter module's services. This way you can (in a way) limit the access to the models and provide the module with an interface of what he can see and do.

Now, accessing the service classes directly, injects another dependency between the modules. Instead of requiring access to the model classes, you now need access to the service classes! And then came the white rabbit out of the hat: he implements a service finder controller helper (Sf_Controller_Helper_Service) that would try to load a service (cached if already found earlier). This way you can implement checks if the service is not available and deal with it accordingly.

I must say I was happily surprised to see this approach and it's something I will further investigate on the "Ultimate Application Design" I am working on.

Performance

The truth is that I didn't expect to see a performance chapter. However, there was chapter 11 "Storefront Optimizations". It did provide with some useful pointers on how to improve performance. First the author discusses general optimizations (opcode caching, require/includes, realpath) and then he talks about caching the application. The information regarding dispatching optimizations was an interesting read (avoid ActionStack).

Testing

Last but not least, the author talked about testing as well. I'm happy to see this in here. People should always test their application. Unit Tests provide a good way to test services and models on expected and unexpected behavior.

Conclusion

From what I have seen this is a good book for a person beginning with Zend Framework. People that have experience with it, will still learn some new tricks and refine their skills. For me there was one minus and that was the model chapter. I would have liked to see more here, but he made good by including the service bit. I got some good ideas from the book which I will most likely be using in the future.

More information

You can read more about the book on the site of PACKT Publishing.

Enjoy!

Jeroen

Comments and Feedback
Hi Jeroen,

I'm new to Zend Framework, but I've finally decided to give it a go.
I bought another book "Pro Zend Framework Techniques" from Apress.

I'm quite disappointed with the content for several reasons.

One of them - there's plenty of the errors in the code - so whoever is trying to follow - has to do some hard thinking in order to complete the project.

Secondly - it shows really basic way of doing CMS using Zend. When book starts with "Pro" I would expect to see some pro techniques.

As I said - quite disappointed, but nevertheless - I look forward to your review - perhaps this one contains more advanced material.

Thanks.
Hmm, I've got this book lying on my shelf for a few months now. I just haven't found the time to read it.

Reading this review I hope I'll find the time to finally start reading it because I think I will still learn a lot from it.

Good review Jeroen!
Tnx for the kind comments! I know the feeling about the books / shelve :)

I have a ton of books I still need to read: One about Prototype/Scriptaculous, one about MySQL Administration. Currently I am reading 3D for iPhone Apps with Blender and SIO2.

Stijn Huyberechts

2010-05-03 17:40
I also read the book, and had the same feeling with the chapter on the Model architecture. A few weeks ago I bumped into this post from Ben Scholzen: http://www.dasprids.de/blog/2010/03/05/modern-application-design-part-1

If you dig into his code you'll find some interesting stuff on how he handles Models with a Service layer. He also promised an article on this bit, but I'm stil waiting :-)

Add a Comment

Your email is never published or shared. Required fields are marked*