jeudi 8 janvier 2015

Registry pattern Vs Service locator pattern Vs Dependency Injection Container

Is there any difference between them rather than set and get objects in an array by key?



class Registry
{
private $container=array();
public static function Set($name,$object){
self::$container[$name]=$object;
}
public static function &Get($name){
return self::$container[$name];
}
}

Aucun commentaire:

Enregistrer un commentaire