All Questions
4 questions
2
votes
1
answer
89
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
275
views
Opposite access to enums
Consider I have many enums (Java) that looks somewhat like this:
...
-2
votes
1
answer
410
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
152
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, ...