All Questions
Tagged with enum design-patterns
6
questions
2
votes
1answer
70 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 ...
1
vote
0answers
61 views
Self Running iterable state machine with Enums in Java
During development I needed to design a state machine with decision which runs to completion and performs state transition without the need to wait for events. So i come up with the following ...
6
votes
2answers
110 views
4
votes
0answers
67 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
1answer
384 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
1answer
118 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, ...