New on his blog today Benjamin Eberlei has posted his own look at dependency injection containers in PHP applications, specifically with the Zend_Application component of the Zend Framework. []

A caching pattern for models

Pascal Opitz has implemented a caching pattern for models using Zend_Cache and the __call magic method. The goal of this pattern was for the model to be able to return calls either uncached or cached, without initializing a cache object every time, and allowing for an easy way to switch between the two in the controller. []
This week Matthew Weier O’Phinney continues his mini-series on using Decorators in Zend_Form. This time talking about how to layer multiple decorators together to build up the full markup of an element. Potentially with reusable parts! []
Matthew Weier O’Phinney, architect on Zend Framework, has started a series of blog posts about Zend_Form decorators. He wanted to explain how they worked since he had seen quite a bit of confusion over them in the past. []

What is Dependency Injection?

On his blog Fabien Potencier has described in a simple manner with excellent examples, just exactly what Dependency Injection is, and how to use it within PHP to good effect. []

Observer pattern in PHP

I’ve recently pretty much fell in love with an observer design pattern. You can basically build the whole application on it using awesome power of event driven programming. What exactly is an observer pattern? Basically we have an object you want to monitor ( observe ) for any changes. Most of the time this object just fires out events and we want to listen to them. We can have more objects observing one or more other objects so basically this can be M:N relationship. []
News and Articles found on the Web
 Design Patterns   News   PHP5 
DevShed’s Alejandro Gervasio has posted a tutorial titled “Introduction to Creating Command Objects with PHP 5”. I’ll trade you details for a page click. []

Decorating with External Data

While working on a project I realized one particular solution was a pretty good way to demonstrate the decorator design pattern together with some of PHP5's features, including abstract classes, interfaces, type hinting, the final keyword and the visibility of properties and methods. This article is intended for those of you who, like myself, are moving from object-oriented programming, including some use of design patterns, in PHP4, to the more complete object model of PHP5. Part of the reason for writing it, was to get to grips with most of these concepts myself, I had also wanted to demonstrate an example of the use of the decorator that involved interaction with an external data source. []
News and Articles found on the Web
 Design Patterns   Intermediate   News   PHP4   PHP5 

Padraic Prepares PHP Pattern Portal

Padraic Brady (sorry for the lack of Unicode, Paddy) is at it again. Not content to help put publishers out of business with a community sourced book, he is now setting up a wiki-based repository for Patterns in PHP. Click the little [ more ] link below for more info and URLS. []

Don't Fear The Reaper

How I do love the web. The web gives us the illusion of anonymity and the freedom to experiment with our inner demons. One such persona of note to the PHP community is Padraic Brady aka “Maugrim The Reaper”. Padraic posts on a variety of topics in his blog but never fails to inform or entertain. Let’s look at two of his recent posts. []