タグ

関連タグで絞り込む (0)

  • 関連タグはありません

タグの絞り込みを解除

wikipediaとdesign_patternに関するInoHiroのブックマーク (2)

  • Composition over inheritance - Wikipedia

    This diagram shows how the fly and sound behavior of an animal can be designed in a flexible way by using the composition over inheritance design principle.[1] Composition over inheritance (or composite reuse principle) in object-oriented programming (OOP) is the principle that classes should favor polymorphic behavior and code reuse by their composition (by containing instances of other classes t

    Composition over inheritance - Wikipedia
  • Visitor パターン - Wikipedia

    Visitor パターンは、オブジェクト指向プログラミング およびソフトウェア工学 において、 アルゴリズムをオブジェクトの構造から分離するためのデザインパターンである。分離による実用的な結果として、既存のオブジェクトに対する新たな操作を構造を変更せずに追加することができる。 基的には Visitor パターンは一群のクラスに対して新たな仮想関数をクラス自体を変更せずに追加できるようにする。そのために、全ての仮想関数を適切に特化させた Visitor クラスを作成する。Visitor はインスタンスへの参照を入力として受け取り、ダブルディスパッチを用いて目的を達する。 Visitor は強力であるが、既存の仮想関数と比較して制限もある。各クラス内に小さなコールバックメソッドを追加する必要があり、各クラスのコールバックメソッドは新たなサブクラスで継承することができない。 Visitor パ

    Visitor パターン - Wikipedia
    InoHiro
    InoHiro 2013/12/30
  • 1