Hi!

Here is the first draft of my RFC:
http://wiki.php.net/rfc/customfactories

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
s...@zend.com   http://www.zend.com/
(408)253-8829   MSN: s...@zend.com

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to