Code: Select all
class Profile {
private $name;
public function load() {
/* Let's pretend this actually uses the DB or something. */
$this->name = "Something";
}
public function getComments() {
/* Magical factory stuff here. */
}
}
What are you thoughts on the design of this? Is this tight coupling setup bad? Is there a pattern I should be looking at instead?
Thanks!