Discriminated unions: prefer khi data-centric, cần exhaustive matching, serializable (Redux actions, API responses).
- Redux Toolkit
createSliceactions là ví dụ thực tế điển hình — mỗi action type là một discriminated union member và reducers exhaustively switch qua chúng. - Class hierarchy: khi cần behavior với data, encapsulation, OOP patterns.
- TypeScript exhaustiveness checking qua never type.