News Feed
Jobs Feed
Sections




Recent Jobs

News Archive
Coders' View Blog:
The Strategy Pattern Using PHP
May 29, 2009 @ 11:14:02

On the Coders' View blog there's a recent post looking at using the strategy design pattern in your PHP application.

In the strategy pattern, algorithms are extracted from complex classes so they can be replaced easily. For example, the strategy pattern is an option if you want to change the way pages are ranked in a search engine. Think about a search engine in several parts - one that iterates through the pages, one that ranks each page, and another that orders the results based on the rank.

Their example shows a class that, based on a few different search "strategies", can locate user information in the user listing. Their example uses a random and a "find after" strategy and includes the results.

0 comments voice your opinion now!
tutorial designpattern strategy



Similar Posts

PHPFreaks.com: PHP Add Text To Image

Adam Jensen's Blog: Spades and the Strategy Pattern

ProDevTips.com: Writing a CMS/Community with Smarty and the Zend Framework: Part 9

Evert Pot's Blog: Creating Streams from Strings in PHP

DevShed: Adding CSS to Handling Views with CodeIgniter


Community Events









Don't see your event here?
Let us know!


joomla performance podcast extension drupal release codeigniter wordpress developer symfony job framework windows facebook feature zendframework microsoft conference opinion sqlserver

All content copyright, 2010 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework