All Questions
Tagged with enum design-patterns
5 questions
2
votes
1
answer
85
views
Defining a finite set of instances of a class to check against [closed]
I have a Type class that will have many instances. I get the instances from a web service. The Type class has a ...
6
votes
2
answers
266
views
Opposite access to enums
Consider I have many enums (Java) that looks somewhat like this:
...
4
votes
0
answers
70
views
Implementing a StringEnum
This is to be used like an Enum (as parameter mostly), but for string
(Using .NET 3.5)
Actual implementation:
...
-2
votes
1
answer
402
views
Enum Singleton implementation in Java
I just wanted to implement the enum singleton in java. Here is my implementation where I have tried to create a singleton DataSource instance:
...
3
votes
1
answer
143
views
An attempt to extend an enum to prevent branching without violating the Open-Closed principle
I love making utility State enums, and giving them methods that do useful things based on which instance of the enum is provided. This works when the enum is very specific to the class I'm working on, ...