mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-10-01 08:46:55 +02:00
Delegation pattern
This commit is contained in:
9
Delegation/Usage.php
Normal file
9
Delegation/Usage.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace DesignPatterns\Delegation;
|
||||
|
||||
// instantiate TeamLead and appoint to assistants JuniorDeveloper
|
||||
$teamLead = new TeamLead(new JuniorDeveloper());
|
||||
|
||||
// team lead delegate write code to junior developer
|
||||
echo $teamLead->writeCode();
|
Reference in New Issue
Block a user