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?

#0057(2024/02/24)memo「良いコード/悪いコードで学ぶ設計入門」第8章~密結合~

Last updated at Posted at 2025-02-24

「良いコード/悪いコードで学ぶ設計入門」第8章~密結合~ を読んで

アクティブリコール

  • クラスが意味のある塊(概念)ごとに実装されていないと、高密度なコードが生まれる
  • 密結合なコードは、依存関係が大きく理解に時間がかかるため、保守をしにくくする
  • GODクラス(Big Ball of Mud)に認定される
    • トランザクションスクリプト
    • 巨大なデータクラス

再読

  • 関心の分離
  • 単一責任の原則
  • DRYの原則→重複コードを許すな!→ただ、概念が異なれば書き方の重複はありえる
  • YANGI
  • 継承と委譲
    • 継承は密結合なコードを生みやすい
    • 継承は継承元のメソッドを書き換えられる可能性がある
  • public変数の多さは密結合につながる
  • テンプレートメソッド
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?