home

George Maicovschi

link The singleton pattern using PHP

Some application resources are exclusive in that there is one and only one of this type of resource. For example, the connection to a database through the database handle is exclusive. You want to share the database handle in an application because it’s an overhead to keep opening and closing connections, particularly during a single page fetch. The singleton pattern covers this need. An object is a singleton if the application can include one and only one of that object at a time.

2 years ago

May 26, 2009

Follow my whole online activity at http://maicovschi.mp