Top "Singleton" questions

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

What should my Objective-C singleton look like?

My singleton accessor method is usually some variant of: static MyClass *gInstance = NULL; + (MyClass *)instance { @synchronized(self) { if (gInstance == NULL) …

objective-c design-patterns singleton object-initializers
Singleton: How should it be used

Edit: From another question I provided an answer that has links to a lot of questions/answers about singletons: More …

c++ design-patterns singleton
What is a singleton in C#?

What is a Singleton and when should I use it?

c# .net singleton
Singleton in Android

I have followed this link and successfully made singleton class in Android. http://www.devahead.com/blog/2011/06/extending-the-android-application-class-and-dealing-with-singleton/ Problem is …

android singleton
Simplest/Cleanest way to implement singleton in JavaScript?

What is the simplest/cleanest way to implement singleton pattern in JavaScript?

javascript function design-patterns singleton
Javascript: best Singleton pattern

Possible Duplicate: Simplest/Cleanest way to implement singleton in JavaScript? I'm using this pattern for singletons, in the example the …

javascript singleton design-patterns
Singletons vs. Application Context in Android?

Recalling this post enumerating several problems of using singletons and having seen several examples of Android applications using singleton pattern, …

java android design-patterns singleton
Using a dispatch_once singleton model in Swift

I'm trying to work out an appropriate singleton model for usage in Swift. So far, I've been able to get …

swift singleton dispatch
Singleton with Arguments in Java

I was reading the Singleton article on Wikipedia and I came across this example: public class Singleton { // Private constructor prevents …

java oop singleton anti-patterns