Don't Write Tagged Class

What’s worse than a class hierarchy? Tagged class.

// Don't do this!
public class Figure {
    enum Shape { RECTANGLE, CIRCLE };
    final Shape shape;
    ...
}
Creative Commons License
This blog by Che-Liang Chiou is licensed under a Creative Commons Attribution 4.0 International License.