mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-08 07:56:36 +02:00
added Visitor pattern
This commit is contained in:
@@ -8,7 +8,7 @@ namespace DesignPatterns;
|
|||||||
* Purpose:
|
* Purpose:
|
||||||
* The Visitor Pattern lets you outsource operations on objects to other objects. The main reason to do this is to keep
|
* The Visitor Pattern lets you outsource operations on objects to other objects. The main reason to do this is to keep
|
||||||
* a seperation of concerns. But classes have to define an interface to allow visitors (the "accept" method in the example below).
|
* a seperation of concerns. But classes have to define an interface to allow visitors (the "accept" method in the example below).
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
interface RoleVisitor {
|
interface RoleVisitor {
|
||||||
public function visit(Role $role);
|
public function visit(Role $role);
|
||||||
|
Reference in New Issue
Block a user