Top "Singleton" questions

A design pattern that ensures that exactly one application-wide instance of a particular class exists.

C++ Singleton design pattern

Recently I've bumped into a realization/implementation of the Singleton design pattern for C++. It has looked like this (I …

c++ design-patterns singleton
What is so bad about singletons?

The singleton pattern is a fully paid up member of the GoF's patterns book, but it lately seems rather orphaned …

design-patterns singleton
Difference between static class and singleton pattern?

What real (i.e. practical) difference exists between a static class and a singleton pattern? Both can be invoked without …

design-patterns static singleton
Creating a singleton in Python

This question is not for the discussion of whether or not the singleton design pattern is desirable, is an anti-pattern, …

python singleton decorator base-class metaclass
What is an efficient way to implement a singleton pattern in Java?

What is an efficient way to implement a singleton pattern in Java?

java singleton design-patterns
How to declare global variables in Android?

I am creating an application which requires login. I created the main and the login activity. In the main activity …

android singleton global-variables state
Is there a simple, elegant way to define singletons?

There seem to be many ways to define singletons in Python. Is there a consensus opinion on Stack Overflow?

python design-patterns singleton
How to create module-wide variables in Python?

Is there a way to set up a global variable inside of a module? When I tried to do it …

python variables singleton module scope
On design patterns: When should I use the singleton?

The glorified global variable - becomes a gloried global class. Some say breaking object-oriented design. Give me scenarios, other than …

design-patterns singleton
Creating the Singleton design pattern in PHP5

How would one create a Singleton class using PHP5 classes?

php oop design-patterns singleton