Created
March 17, 2009 21:15
-
-
Save johannilsson/80766 to your computer and use it in GitHub Desktop.
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 | |
class Domain_Model_User { | |
private $id; | |
private $name; | |
} | |
interface Domain_Model_UserRepository { | |
public function save(Domain_Model_User $user); | |
public function find($id); // Returns Domain_Model_User | |
} | |
class UserService { | |
public __construct(Domain_Model_UserRepository $userRepository) { ... } | |
public function doSomething(); | |
} | |
// Some implementations... | |
class Infrastructure_Persistence_UserRepositoryXml implements Domain_Model_UserRepository { | |
... | |
} | |
class Infrastructure_Persistence_UserRepositoryMySql implements Domain_Model_UserRepository { | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment