Questions tagged [singleton]
The singleton is a design pattern to ensure that exactly one application-wide instance of a particular class exists.
9
questions
12
votes
4
answers
5k
views
Sound manager for Android
I created a singleton class for managing sound effects on Android. This class will only be instanced and loaded once at the beginning, and each activity will use the loaded songs.
I don't know either ...
67
votes
9
answers
29k
views
Implementing a Singleton pattern in C#
Is this the best way to implement this pattern in C#?
...
31
votes
1
answer
29k
views
Single-instance WPF application
This is the code I implemented so far to create a single instance WPF application:
...
18
votes
3
answers
44k
views
Singleton using enum
Is this the correct implementation of a singleton using enum?
...
7
votes
1
answer
501
views
Prime Numbers Store
Let's say we need to create a store for selling prime numbers.
Users enter the store and ask to buy a number.
If the number asked is a prime number,
1.1. then it's either available for sale
1.2. ...
6
votes
2
answers
252
views
Building in the built-in declarations
In order for Rubberduck to be able to "recognize" the built-in VBA functions, procedures and objects, I added yet another constructor parameter to my Declaration ...
6
votes
2
answers
874
views
Singleton design pattern
I am a beginner in PHP-OOP and design patterns. I have got this basic piece of code in Singleton Pattern and I changed it in order to understand its behavior. I can see that it works as expected.
...
5
votes
2
answers
6k
views
Using a singleton class to get and set program wide settings
The following code works and does what I want, but I'd like to confirm I'm using this OOP concept correctly. I'm using the following class to get and set some configuration parameters for my program. ...
3
votes
2
answers
17k
views
Simple singleton database connection pool
I'm studying design patterns, and to demonstrate a singleton, I've implemented a primitive database connection pool.
ConnectionPool.java
...