News Feed
Sections




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

IBM developerWorks:
Five common PHP design patterns
July 19, 2006 @ 06:09:24

The IBM developerWorks site brings us yet another fine PHP-related article with this new tutorial today, a look at five common design patterns (and how to use them).

It's difficult to demonstrate the value of patterns using small examples. They often look like overkill because they really come into play in large code bases.

This article can't show huge applications, so you need to think about ways to apply the principles of the example -- and not necessarily this exact code -- in your larger applications. That's not to say that you shouldn't use patterns in small applications. Most good applications start small and become big, so there is no reason not to start with solid coding practices like these.

The five patterns they cover are:

  • the Factory pattern
  • the Singleton pattern
  • the Observer pattern
  • the Chain-of-Command pattern
  • the Strategy pattern
For each, they explain (basically) how it works and include some sample code to show it in action. There's also diagrams showing how the different parts of the pattern relate to each other.

0 comments voice your opinion now!
common five design patterns example tutorial common five design patterns example tutorial


blog comments powered by Disqus

Similar Posts

Edd Mann: Storing PHP Sessions/File Caches in Memory using TMPFS

Gonzalo Ayuso: Handling several DBALs in Symfony2 through the Dependency Injection with PHP

Reddit.com: Hack: How to open the black box of Hacklang as a PHP developer

Oracle Technology Network: Integrate PHP & Java Applications w/Oracle WebLogic Server & Zend Server

WebReference.com: Unary, Binary, and Ternary Operators in PHP


Community Events





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


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

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