Wednesday, 28 February 2007
Use of Strategy Pattern in Your PHP Applications |
| |
|
| |
Alejandro Gervasio, in the first article of a two-part series, speaks about the strategy design pattern and how it can be used in your PHP applications. He introduces the basic concepts concerning the implementation of the strategy pattern in PHP 5. He says this pattern can be used in multiple contexts, and also can be utilized in a wide range of predefined strategies.
He further says, there are certain design patterns that are usually applied than others. That’s the case with the subject of this article, the strategy pattern. He exemplifies with the validation of all the forms included in your web sites. He says, in the first step, you create a few validation functions (or classes), then use these functions to check the validity of the data supplied by users, and determine the course of action to be taken accordingly. This is a concrete implementation of the strategy design pattern, he initiates.
He demonstrates the practical side of the topic with illustrative examples under the following heads:
|
| |
|
Read the Post
|
| |
|
|
| |
|
|
| |
|