LoginSignup
0
0

More than 3 years have passed since last update.

Java Design Patterns

Last updated at Posted at 2020-11-08

デザインパターンまとめ

オブジェクト指向とはシステムの開発、保守、拡張時に、追跡困難なバグの発生を抑えるために、様々な工夫を施す開発指向です。

java デザインパターンは、クラスの再利用性を高めることで拡張しやすく、保守しやすいシステムづくりを指向します。

下記は未完成なMenuです
*はリンク切れしてます

Menu

Iterator
Adapter
Template Method
Factory Method
Singleton
Prototype
Builder
Abstract Factory
Bridge
Strategy
Composite
Decorator
Visitor
Chain of Responsibility
Facade
Mediator
Observer
Memento
State
Flyweight
Proxy
Command
*Interpreter

オブジェクト指向のヒント

オブジェクト間の依存性を薄める

・抽象クラスやインターフェイスプログラミングを意識する
・正しく動くクラスは修正せず拡張して使う
・ The Liskov Substitution Principle(LSP)を意識する
  Superクラス型の変数を利用して、そのサブクラスを一括して扱う
  instanceofを使いたくなったら意識する(instanceofではなくLspでできないか?)

0
0
1

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