LoginSignup
1
2

More than 5 years have passed since last update.

オブジェクト指向設計の原則

Last updated at Posted at 2018-04-14

オブジェクト指向設計の原則(SOLID原則)

SOLID原則はクラス設計に関わる原則

1. SRP(単一責任の原則)
2. OCP(オープン・クローズドの原則)
3. LSP(リスコフの置換原則)
4. DIP(依存関係逆転の原則)
5. ISP(インタフェース分離の原則)

1. SRP(The Single Responsibility Principle)

クラスに与える責務は一つだけ。

2. OCP(The Open-Closed Principle)

修正なしで拡張可能にする。

3. LSP(The Liskov Substitution Principle)

4. DIP(The Dependency Inversion Principle)

5. ISP(The Interface Segregation Principle)

SOLID原則以外のオブジェクト指向設計の原則

パッケージに関するものなどの原則が存在する

  • REP(The Reuse/Release Equivalence Principle)
  • DRY(Don't Repeat Yourself)
  • PIE(Program Intently and Expressively)
  • SDP(Stable Dependencies Principle)
  • ADP(Acyclic Dependencies Principle)

参考

1
2
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
1
2