News Feed
Sections




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

DevShed:
Validating User Input with the Strategy Pattern
March 08, 2007 @ 07:56:00

DevShed is wrapping up their look at the Strategy pattern with the last part of their series posted today - a look at validating a user's input via the pattern.

In the next few lines I'm going to demonstrate how to use the strategy pattern in a useful case, that is validating user-supplied input. Sound like an interesting experience, right?

They start by show how to build a "validation strategy selector" that uses a switch to hand off the request to the correct validation function. Naturally, this is followed by the creation of those validation classes and an example of their use. They wrap it all up with the complete code listing to make cut and paste coding easy.

1 comment voice your opinion now!
tutorial designpattern strategy validate user input tutorial designpattern strategy validate user input


blog comments powered by Disqus

Similar Posts

EchoDitto Labs Blog: How to Configure Eclipse PDT with Zend Server Debugger on MAMP for Drupal

DevShed: Retrieving Information on Selected Files with a PHP 5 File Uploader

Raphael Stolt's Blog: Logging to MongoDb and accessing log collections with Zend_Tool

Dave Marshall' Blog: Asynchronous cache priming with progress bars via Gearman, Memcache and Dojo

NETTUTS.com: The Problem with PHP’s Prepared Statements


Community Events





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


opinion introduction version library symfony language package community podcast interview voicesoftheelephpant series tool composer security release update framework install laravel

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