Created
October 1, 2011 15:53
-
-
Save lloc/1256232 to your computer and use it in GitHub Desktop.
Factory Method Using
This file contains 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 characters
<?php | |
/* gibt z.B. 'Am 05.03.2007 um 12:12 Uhr wurde die Datei geaendert.' aus. */ | |
$obj = Factory::create (__FILE__); | |
print $obj->repr (); | |
/* gibt 'Es ist ein Fehler aufgetreten!' aus */ | |
$obj = Factory::create ("nicht-existierende-datei"); | |
print $obj->repr (); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Related post: http://lloc.de/design-patterns-factory-method.html