Category Archives: Design Patterns

A PHP Singleton Flip-Flop, TRUE or FALSE

When I was learning computer internals, the hardware logic component that was the foundation of the computer was the flip-flop. The flip-flop was an electrical circuit that was either a one or zero. That usually translated to +9 volts or … Continue reading

Posted in Design Patterns | Leave a comment

The Singleton – Using a Singleton

In our last article, we built a framework for the singleton class. In my real world example, we designed a singleton class that would give us a current Year for use throughout our accounting system. How do we use it … Continue reading

Posted in Design Patterns | Tagged | Leave a comment

The Singleton

One of the first PHP design patterns that sticks in your mind when learning about design patterns is the Singleton pattern. Why? Because the Singleton has a catchy name and is easy to remember. The purpose of a singleton is … Continue reading

Posted in Design Patterns | Tagged | Leave a comment