0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

#0055(2024/02/24)memo「良いコード/悪いコードで学ぶ設計入門」第6章~条件分岐~

Last updated at Posted at 2025-02-24

「良いコード/悪いコードで学ぶ設計入門」第6章~条件分岐~ を読んで

アクティブリコール

  • switch, if/elseによる条件分岐はカオスになる
    • 変更に弱いコード
  • データクラスの活用

再読

  • 早期returnで可読性を高める
  • 初級者はswitchでの実装を試みる、中級者はinterfaceを使ったクラス設計を考える
  • 型チェックで分岐しない!
  • フラグチェックは可読性が低くなる→ストラテジパターン

あとで調べる

  • リスコフの置換原則
  • 値オブジェクト
  • ストラテジパターン
  • 抽象クラスとインターフェース
  • ポリシーパターン
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?