News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Mutant PHP Blog:
Specifications for PHP5
September 30, 2008 @ 11:17:47

In a recent entry to his blog Sean shows off a new specifications library he's created to replace common comparison functionality with a series of specs.

I thought I'd share a PHP library implementing this idea by Evans and Fowler. Written for PHP5, it's a library for defining custom specifications using composition and inheritance.

He gives the example of "Person" objects with name and age properties. A search might involve looking directly at the properties to location one that's, say, younger than 35 and has a last name of Johnson. His specification class replaces this and makes it more reusable by applying things like GreaterOrEqualSpecifications and EqualSpecifications to standardize the evaluation. Then its just a quick call to the isSatisfiedBy method to check for correctness.

0 comments voice your opinion now!
specification php5 class download evaluate reuse


blog comments powered by Disqus

Similar Posts

HowTo Forge: How To Set Up A Facebook RSS Feed Reader

John Mertic's Blog: PHP 5.2.5 Windows Installer now working

Tony Bibbs' Blog: HOWTO: Deploy Your Application Using PEAR

HowToForge.com: How To Set Up suPHP With PHP4 And PHP5

Stuart Herbert's Blog: Arguments From The Boardroom, Not The Bedroom


Community Events





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


unittest language zendserver framework interview opinion deployment package introduction bugfix series library laravel update api symfony release podcast community version

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