Where do enumerations belong
Posted
by griegs
on Stack Overflow
See other posts from Stack Overflow
or by griegs
Published on 2010-05-10T23:19:47Z
Indexed on
2010/05/10
23:24 UTC
Read the original article
Hit count: 208
At my current place of emplyment they were putting enumerations into the class they used them in. Whilst I didn't see any duplication of these enumerations I non the less thought that they didn't belong in the class so I moved them out into their own class.
The reason I did that was that I wanted them to be re-usable w/out needing to reference the model class they were originally in.
I got asked why I did that by the boss who disagreed with me as to my reasons for moving them and say nothing wrong with putting enumerations in a model class.
So where should they be? Is it acceptable to leave enumerations in a class and hope that others in the project know to refactor your code if they want to re-use it elsewhere or should, as I did, you create an enumerations class and have them all in there?
© Stack Overflow or respective owner