Re: RFC: Custom Factories (SPL)
Hi!
Something I'm missing in this RFC: what's wrong with factory base class doing:
public static function getInstance() {
if(static::$instance === NULL) {
static::$instance = new static;
}
return static::$instance;
}
instead of "new self", and then the client class doing:
$this->logger = WhateverLogger::getInstance();
or even:
$clientLogger = $this->config['logger'];
$this->logger = $clientLogger::getInstance();
Also, the whole thing, whatever it is, looks like something one would do in user space in a framework, not on language level.
--
Stanislav Malyshev, Zend Software Architect
stas@zend.com http://www.zend.com/
(408)253-8829 MSN: stas@zend.com
Thread (22 messages)