News Feed
Sections




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

PHPEasy.co.uk:
Design Patterns - The Singleton Pattern
July 16, 2012 @ 10:54:40

PHPEasy.co.uk has a new tutorial posted introducing one of the most common (and often misused) design patterns out there - the Singleton pattern.

In this first tutorial in the design pattern series we are going to investigate and implement the singleton design pattern. [...] A design pattern is a common solution to a given problem, problems in programming tend to recur and we often find ourselves trying to solve the same issues over and over. The common techniques that provide solutions to these problems can be referred to as design patterns.

He talks about some of the most common uses for the Singleton pattern (mainly replacing a global variable) and includes an example of using one to fetch a database object.

0 comments voice your opinion now!
singleton designpattern tutorial example


blog comments powered by Disqus

Similar Posts

Vanessa Vasile's Blog:Using PHP to Extract Image Exif Data

Community News: Sara Golemon & Christopher Jones - First Day Summaries of php|works

Michael Girouard's Blog: Rolling Your Own MVC: The View

DevShed: Building an Error Logger with the Chain of Responsibility Pattern in PHP 5

PHPBuilder.com: Using Zend_Search_Lucene, the PHP Lucene Implementation


Community Events

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


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

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