News Feed
Sections




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

PHP-Tip-a-Day:
PHP Tutorial The Allegory of The Factory Pattern
June 12, 2012 @ 09:13:24

On the PHP-Tip-a-Day site there's a new post from Greg Bulmash with an allegory about the Factory pattern (design pattern) to relate it to something a bit more practical and introduce some of its core concepts.

If you've read the About This Site page, you'll know that instead of pursuing my passion for computers, I got sidetracked into the arts in college. So when it came time for me to learn and explain the Factory Pattern, I thought it might be fun to express it as an allegory...

His example involves cars, axles and wood to illustrate how the Factory pattern lets you generate objects of different types automatically without having to worry about how they're created. He includes a code example in the form of an interface and a class that implements it (the "Axle" class).

0 comments voice your opinion now!
factory pattern allegory tutorial interface example


blog comments powered by Disqus

Similar Posts

DevShed: Developing a Form Director Class

SitePoint PHP Blog: Find and Correct Misspelled Words with Pspell

PHPClasses.org Blog: Book Review: Pro PHP: Patterns, Frameworks, Testing and More

Alan Knowles' Blog: Getting Started with HTML_FlexyFramework, DataObjects and HTML_Template_Flexy

Federico Cargnelutti's Blog: Format a time interval with the requested granularity


Community Events

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


introduction community release extension language feature api unittest series development voicesoftheelephpant library laravel wordpress interview opinion threedevsandamaybe podcast framework laravel5

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