Use an enum when data can belong to a fixed set of known states. Naming those categories explicitly preserves the constraint and makes intent easier to understand than free-form strings or numeric codes. section 4.3
Representing closed categories
Instead of passing a string or numeric code whose allowed values must be remembered, represent the value with an enum or equivalent construct. The model then communicates that only the defined categories are valid. section 4.3
Keep the design useful rather than ceremonial:
- Choose an enum when explicit categories reduce ambiguity and make behavior easier to follow. section 4.3
- Route limited data-driven variation through clear switching expressions or pattern matching when explicit branching communicates the decision better than added abstraction. section 4.3






















