On design patterns: When should I use the singleton?
class Singleton
{
private static Singleton instance;
private Singleton() {}
One way I've used a singleton is to implement a "main controller" object for an application. This was a bit like the Application object you get with VBA.
This object performed various startup and shutdown tasks. It also provided access to application-wide settings and services. This included values of command-line parameters and the logging service, among others.