I guess I missed the Zend PHP Framework webcast on Friday. I was looking forward to it, but I signed up a while ago and forgot about it. By the time I got the reminder email, it was too late. Fortunately, the recording is now available. If you have an interest in ZPF or frameworks in general, you should watch this.
I won’t try to summarize the webcast here, but instead offer a few impressions.
I found the webcast to be interesting, although it didn’t really answer the primary questions I have about the structure of the front controller and form processing. ZActiveRecord, ZMail, and ZSearch are fine components, but my interest lies in the controllers because that is the area where there is the least consensus about the state of the art. One red flag for me was the suggestion of putting business logic in actions. Nothing but a high level overview was given of the controllers, but this perks my ears as an issue in MVC separation.
The coding standards emphasize not reserving global resources. The framework will not define functions or global constants, it uses exceptions and doesn’t reserve __autoload for its own use. This is very good. On the other hand, it seems to rely on static methods quite a bit, which I think can burn you over the long run if you are trying to offer a componentized architecture and can make code more difficult to test. I’ve been moving away from static methods as much as I can in my own code. Eventually, I always seem to regret using them. They lure you in at the beginning with the promise of simplicity and then they punish you later with their inflexibility.
I wonder how many of the components do their own “connection management” such as with the ZSearch::open (static methods again)? This strikes me as an opportunity for a general dependency injection mechanism. A technique that we are emphasizing more and more in WACT, but which I don’t think has reached widespread use in the PHP framework world.
One of the stated goals of the Zend Framework is to improve the PHP ecosystem. The webcast suggests that Zend PHP Framework will play well with others, allowing you to use the components independently, or for example use a different templating system with the framework. On the other hand, Andi suggested that all components will be distributed in their entirety. When asked if a stripped down version could be distributed, the answer was “Why would you want to?”
I don’t think a monolithic distribution mechanism will play well with the new ecosystem of components that is rising up based on the PEAR installer’s new channel capability. Eventually, the PEAR installer will move into the end user application installation space. To participate in this, ZPF should be available over a channel. I think a key success factor for the Zend framework will be the release of individual components via a PEAR channel.
It is much better to be able to declare dependencies on individual packages, rather than on one huge bundle of components. Monolithic distribution unnecessarily ties together the release schedules of packages that might otherwise have no common dependencies. Micro-packages on a PEAR channel are the future of PHP web application installation.
Overall, I think Zend is taking a good approach to the development of ZPF. I look forward to learning more.
Update: Just as writing tests is an important process element, because testable code is better code, I think that micro package releases are better than monolithic package releases from a process standpoint. The mere act of writing the components so that they can be independently released highlights unhealthy dependencies. This, of course, has to be tempered by an overall vision and cross-package duplicate code elimination. Two areas that have been challenges for PEAR with its political fiefdoms surrounding each package and one reason why PEAR is not a framework.
(P.S. Hurry up and release ZSearch. I want to use it.)