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

More than 1 year has passed since last update.

オブジェクト指向の設計の目標

Posted at

実行効率より、保守性や再利用性
実行効率に関してはここ最近になって、ハードウェアの能力が著しく上がっているため、そこまで重要視されなくなった。

保守性と再利用しやすいソフトウェア構造の目標

  1. 重複を排除する
  2. 部品の独立性を高める
  3. 依存関係を循環させない

重複の排除

  • 機能の重複があればあるほど、その分だけ規模が大きくなるため、テストが大変になり、理解もしづらくなる。
  • しばらく時間がたってから、プログラムの変更時に修正漏れが起きやすくなるため。

部品の独立性を高める

  • 簡単に言うと、個々の部品の機能のまとまり度合いが強く、部品間の結びつき度合いが弱いと良い設計と言われる。クラスを例にするなら、クラス内の変数やメソッドのまとまりは強く、クラス同士の結びつきが弱いと良いということ。

依存関係を循環させない

  • 依存関係を循環させると、循環させている部品のどこかを修正した場合に、全てを調べる必要が出てくるため。
1
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
1
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?