Featured Post

Integrating FirePHP with Zend Framework 2 using Composer

Introduction If you previously integrated FirePHPCore with Zend Framework using this description just remove require_once(realpath(__DIR__ . ‘/../../vendor/firephp/FirePHPCore/FirePHP.php’)); instance, where you include FirePHP library in global.php Modifying Composer configuration Now you...

Read More

A review of the book: Zend Framework 2 Cookbook from Packt Publishing

Posted by evolic | Posted in Book review, Programming, Web development | Posted on 04-05-2014

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,


Review of the book: Zend Framework 2 Cookbook written by Josephus Callaars, issued by Packt Publishing.

There is many cookery books although I haven’t seen yet any about Zend Framework 2.
No matter how you name the book, title is just a title and every book have to stand out of the competitions. Otherwise is will be just one of the many cookbooks…

 Zend Framework 2 Cookbook

To be honest – there is no too much books about Zend Framework 2, so writing such book is worth fighting for.

The typical cookery book contains many recipes, provided with nice looking pictures and hints about how to make some dish or meal. Cookbooks teach people by practice and repetition till we reach perfection.

We won’t become good cook-progammer in 24 hours, which is quite often used in the books related to Computer Science, trying to convince us that it is possible.

Did the author rised to the occasion?

I will try to answer for that question in this review.

Small amount of the chapters regarding to the competitors

At the beginning I would like to say, that this is my third book covering web development with Zend Framework 2, which I had an occasion to read and thus I have some experience, I know the framework quite well and I can compare this book with the previous ones.

This book contains only 9 chapters, which is not too much comparing to Zend Framework 2 Application Development issued also by Packt Publishing. It means that the ZF2 cookery book could be a little longer (e.g. with 3-4 chapters), which would make it much better for the readers.
For comparison, Web Developent with Zend Framework 2 written by Michael Romers is provided with 27 chapters and could be called reference book.

To be honest, Josephus Callaars wrote about essential components of the framework, but I left a little bit unsatisfied.

Book contents

After explaining the routing, dependency injection, description of the Event Manager, I expected few paragraphs about the Service Manager, which are hardly to find along with the book.

After that we can read about translating the application into another languages and sending and receiving mails (the author covers here many ways of mail transport).

Next chapter is focused on the forms, which covers creating them (Zend\Form) using annotations, basics form elements (e.g. inputs, buttons) and form view helpers. We can also find good description of the implementing our own, custom form view helper for video tag, introduced with HTML5.

Furthermore we can read about View layer, but for me – there is missing part about partials. On the plus side I can mention about creating your own strategy class rendering the view as XML.

Later Josephus Callaars describes model layer, but instead of Zend\Db he shows how to write raw SQL statements and devotes much attention for creating his own implementation of the DAO (Data Access Object), which cannot be equal to Zend\Db, not to mention about the ORM systems (Object-Relational Mapping), such as Doctrine or Propel.

In the next chapters we can read about:

  • creating modules in Zend Framework 2,
  • implementing own service class,
  • securing the application (very detailed),
  • optimising application performance,
  • errors handling: catching and logging exceptions,
  • using unit testing with PHPUnit.

At the end of the book we can find short guide about starting own project with Zend Framework 2 and what is important to know about. Josephus Callaars gives the reader the diagram describing the workflow of the HTTP request processing in ZF2, but it could looks better and be more readable.

The recipes are the ones, what is missing in this book for me: for example usage of the described routing types or another parts of the web application. I could say that in the following way: the author inform you about exotic and common fruits and vegetables, but doesn’t provide you the recipes, which could make your meals extraordinary or unusual. You are informed about these ingredients, but don’t know how to use them in real life.

Reading impressions

The author gives a lot of theoretical knowledge, but for me – he does it in a little inconsistent way.

In one case he describes something very detailed and concretely, and writes perfunctorily about the other things (e.g. writing unit tests for all three MVC layers, which could show the reader how to use TDD in real samples), and another topics are not covered at all (np. using ORM systems or something about Zend\Db).


Is this cookbook worth or buying?

I will try to paraphrase using following comparison:

  • yes – if you are good Zend Framework 2 cook and would like to learn more about it,
  • no – if this is just a beginning of your adventure with Zend Framework 2.

The book contains many advanced topics and samples, which are very hard to find in the other books and which could expand your knowledge about the framework for sure. But these hints are rather for these ones, who have the basics of the Framework created by Zend company, than for the beginners..

Dummies could be a little confused reading this book (skipping many important topics and providing the theoretical knowledge in a little unconsidered way).

Related posts

My review of the book: Zend Framework 2 Application Development, written by Christopher Valles and issued by Packt Publishing.

Write a comment