パンくず
書籍 Patterns to Patterns
Protection
Replace Type Code with Class
概要
Replace Type Code with Classについて
使用する場面
タイプの指定ミスによるバグが想定される場合。
対応方法
Stateパターンを適用します
利点と欠点
利点
・不正なパラメータや比較対策
欠点
・通常よりも、多くのコードを必要とする
書籍 Patterns to Patterns
Protection
Replace Type Code with Class
Replace Type Code with Classについて
タイプの指定ミスによるバグが想定される場合。
Stateパターンを適用します
・不正なパラメータや比較対策
・通常よりも、多くのコードを必要とする