How do you specify states? State Pattern, Enums or ...?
-
I'd like to gain an overview of the whens and whys about state specifications/implementations. How do you go OOP when specifying states? Or do you prefer an enum? ints? ... References are also appreciated. I am very mixed about this topic, so you will get no religious opinions from here. Thanks! Keld Ølykke
-
I'd like to gain an overview of the whens and whys about state specifications/implementations. How do you go OOP when specifying states? Or do you prefer an enum? ints? ... References are also appreciated. I am very mixed about this topic, so you will get no religious opinions from here. Thanks! Keld Ølykke
I'll go for enum over int every time because there probably isn't going to be billions of states and by strongly typing the values, it makes the design a lot more robust and maintainable. MyState.Enabled as opposed to 1 is a lot easier to work with.
"You get that on the big jobs."
-
I'll go for enum over int every time because there probably isn't going to be billions of states and by strongly typing the values, it makes the design a lot more robust and maintainable. MyState.Enabled as opposed to 1 is a lot easier to work with.
"You get that on the big jobs."
Thx