Upgrade to Pro — share decks privately, control downloads, hide ads and more …

OOP, Double Dispatch and Visitor Pattern

OOP, Double Dispatch and Visitor Pattern

OOPのエッセンスとビジターパターンを使ったディスパッチのデザインパターン。弁護士ドットコム社で紹介。

Akihito Koriyama

May 24, 2024
Tweet

More Decks by Akihito Koriyama

Other Decks in Technology

Transcript

  1. "TL

  2.  w WJTJU%FQFEFODZ w WJTJU/FX*OTOUBDF w WJTJU"SHVNFOUT w WJTJU"SHVNFOU w

    WJTJU4FUUFS.FUIPET w WJTJU4FUUFS.FUIPE %BUB  w OFX*OTUBODF wDMBTT/BNF wBSHVNFOUT wBSHVNFOU wTFUUFS.FUIPET wTFUUFS.FUIPE wNFUIPE/BNF wBSHVNFOUT wBSHVNFOU Visitor Dependency
  3. w Visitor public function visitSetterMethods( array $setterMethods ) { foreach

    ($setterMethods as $setterMethod) { $setterMethod->accept($this); } }