On DeveloperTutorials.com there's a new tutorial dealing with one of the design patterns for applications as applied in PHP - the Singleton Pattern.
One of these design patterns is called the Singleton. It's purpose can be described quite briefly as follows: "Ensure a class has only one instance and provide a global point of access to it."
It achieves this by only creating a new instance the first time it is referenced, and thereafter it simply returns the handle to the existing instance.
In software engineering, a design pattern is a general solution to a common problem in software design. A design pattern isn't a finished design that can be transformed directly into code, it is a description or template for how to solve a problem that can be used in many different situations.
Hence the "single" in Singleton...and in this tutorial, they show you how to implement it quickly and easily - complete with code, explainations, and advantages/disadvantages of their methods.




