Last active
August 29, 2015 14:21
Revisions
-
kandran revised this gist
May 14, 2015 . 4 changed files with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ <?php require_once("ApplicationInterface.php"); class ApplicationA implements ApplicationInterface{ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ <?php require_once("ApplicationInterface.php"); class ApplicationB implements ApplicationInterface{ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ <?php require_once("ApplicationInterface.php"); class ApplicationStarter{ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ <?php require_once("ApplicationA.php"); require_once("ApplicationB.php"); require_once("ApplicationStarter.php"); -
kandran created this gist
May 14, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ <?php require_once("ApplicationInterface.php"); class ApplicationA implements ApplicationInterface{ public function run() { echo "<br/> Application A start running"; //some computation echo "<br/> Application A finished"; } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ <?php require_once("ApplicationInterface.php"); class ApplicationB implements ApplicationInterface{ public function run() { echo "<br/> Application B start running"; //some other computation echo "<br/> Application B finished"; } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ <?php interface ApplicationInterface { public function run(); } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ <?php require_once("ApplicationInterface.php"); class ApplicationStarter{ public function startApplication(ApplicationInterface $application) { $application->run(); //here we don't know the class name of application } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ <?php require_once("ApplicationA.php"); require_once("ApplicationB.php"); require_once("ApplicationStarter.php"); $applicationStarterObject = new ApplicationStarter(); $application1 = new ApplicationA(); $application2 = new ApplicationB(); $application3 = new ApplicationA(); $applicationsToRun = array($application1, $application2 , $application3); foreach($applicationsToRun as $application){ $applicationStarterObject->startApplication($application); }