Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.