Archive for February 27th, 2007

DevShed: Introducing the Strategy Pattern

DevShed is taking a look at another design pattern today in part one of their look at the Strategy Pattern:

That’s exactly the case with the subject of this article, the strategy pattern. To put things more clearly, I’m sure that you always validate adequately all the forms included in your web sites. First off, you create a few validation functions (or classes), then use these functions to check the validity of the data supplied by users, and finally determine the course of action to be taken accordingly.

To make the concept clearer, they Create a simple example - a file handling class that can read and write data to the file of the developer’s choosing. This base class is then used inside their StrategySelector class to make saving both HTML and XML data as simple as a basic string.

Continue Reading · Add comment

Stubbles Blog: More PHP6 Wishlist Talk (Annotations)

Frank and Stehpan has posted two more items in their “PHP6 wishlist” series” today - both mentioning annotations.

In Stephan’s post:

Porting JavaDoc comments to PHP was one of the best things, that ever happened to to PHP4. But like in Java 4, the DocBlocks in PHP evolved from plain documentation to a feature that adds meta information to classes, methods, properties and variables. IDEs, like Zend Studio, use the @var tag to enable type hinting for method return values, which would not possible without the DocBlock, as PHP is a dynamic languages.

And from Frank:

In part three of his wishlist for PHP 6 Stephan wrote that he would like to see annotations built into PHP 6 directly. I disagree with him about that. Annotations can be done in userland, without any problems. He already gave some examples of projects that accomplished this task. But if you look at them you see that every project has a different solution on how to implement annotations for PHP which leads to the problem that if you use different projects in your own application you have to handle all their ways of treating annotations. Annoying, isn’t it?

Continue Reading · Add comment

Introducing the Strategy Pattern

The strategy design pattern can be very useful in the context of form validation. This article the first of two parts will introduce you to the strategy pattern and give you some idea of how you can use it in your own PHP applications….

Refurbished and Used Networking Equipment Network Liquidators sells refurbished and used networking equipment for up to 95% off list, with a 1 year warranty. We buy and sell top brands like Cisco, Extreme, Foundry, and more. Call us for best pricing.

Continue Reading · Add comment

Zend Developer Zone: PHP in Action - Chapter 7, Design Patterns. Part - II

On the Zend Developer Zone, there’s a new post pointing to the second part of their look at the Manning Publishing book “PHP in Action”.

If you’ve been anxiously awaiting part two of this series then your wait is over. Here’s a short introduction to the section part of this series written by the author of the book, Dagfinn Reiersol. I had the privilege of meeting Dagfinn at phpuk last week. Below the introduction is the link I know you’ve been waiting for.

The new PDF they link to focus on two different patterns - the Decorator (a wrapper class) pattern and the Null Object (an object that works like the others but does nothing behind the scenes) pattern.

Continue Reading · Add comment

Symfony Blog: Symfony conferences

Francois Zaninotto has posted about two upcoming instances where the Symfony Framework’s presence can be seen - a conference about it in Paris and at the PHP Quebec Conference.

Two upcoming events may be of great interest for symfony fans. The French PHP User association (AFUP) organizes a conference about symfony 1.0 in Paris. […] Also, the PHP Quebec Conference features two sessions about symfony, one in English and one in French.

The Paris confernece is happening on March 6th and the PHP Quebec Conference March 14th through the 16th in Montreal.

Continue Reading · Add comment