December 2016
Beginner to intermediate
238 pages
6h 10m
English
© Kelt Dockins 2017
Kelt Dockins, Design Patterns in PHP and Laravel, 10.1007/978-1-4842-2451-9_26
Kelt Dockins1
(1)Dolph, Arkansas, USA
$> git checkout visitorRepresent an operation to be performed on the elements of an object structure. Visitor lets you define a new operation without changing the classes of the elements on which it operates.1
This is probably one of the most complicated GoF patterns I’ve seen. The first time I stared at the UML diagram after a while I said, “hmm, wat 2?” At its basic form, this pattern is all about extracting methods from semi-related or unrelated classes. When you do this, you no longer have to change or revisit (pun intended) the code. After reading more about this pattern I ...
Read now
Unlock full access