In many cases, enumerations are a good fit for the needs of
a system. However, if and when the concept being modeled by the enum gains any
kind of behavior beyond its numeric constant and developer-friendly label, it
may be time to consider moving from an enum to a class. In this article,
you've seen how you can easily make this transition with minimal changes in
your code that already makes use of an enum, provided that you keep the same
naming convention for your class and its named static instances.
Learn more about software development best practices in my Principles
of Object Oriented Design course available from PluralSight.
You can follow me on my
blog at SteveSmithBlog.com and on Twitter at twitter.com/ardalis. You can download the
(very small) sample code for this article.