software development; agile thoughts
Sunday, 7 June 2015
Do not represent an object's life cycle using enums
Avoid 'summarising' the state of an object using enums.
While it is often convenient to idealise an object's life cycle as a linear sequence of states, such representations are inherently inaccurate and fragile; over time they become a source of bugs.
Share to Twitter
Share to Facebook
Share to Pinterest
Post a Comment
Post Comments (Atom)