Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
The register contains code that can initialize the requested object at any time. after the first initialization, it will keep a reference to the object and return it on subsequent requests
class Registry()
{
public function get($serviceId)
{
return isset($this->services[$serviceId]) ? $this->services[$serviceId] : $this->initializeService($serviceId);
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question