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?

依存性逆転の原則の図的理解

Posted at

手続き型のプログラムを書くと、操作元が操作先の情報を知ることになる
image.png

依存先が増えてくると、だんだん操作元のプログラムが大きくなってきてしまう
image.png

これを解決するために操作元のプログラムが行う動作を限定した規格を作り、
操作先のプログラムが規格に従うようにする
image.png

操作元とドキュメントを1つのパッケージにまとめ上げると、操作元に操作先が依存しているように見える
image.png

元の図と見比べると、操作元と操作先の依存関係が逆転しているので依存性逆転の法則と呼ばれる
image.png

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?