diff options
author | Sebastian Bergmann <sebastian@php.net> | 2003-11-24 18:31:47 +0000 |
---|---|---|
committer | Sebastian Bergmann <sebastian@php.net> | 2003-11-24 18:31:47 +0000 |
commit | e712007972122e3db9defa7d6fb3f77da5481955 (patch) | |
tree | e93c23af93ecac3294c4b37e645d7459930fb749 /Zend/RFCs | |
parent | d1a04493bb7b2f39c3527c73b2a5338a1f1739ac (diff) | |
download | php-git-e712007972122e3db9defa7d6fb3f77da5481955.tar.gz |
No longer needed.
Diffstat (limited to 'Zend/RFCs')
-rw-r--r-- | Zend/RFCs/004.txt | 107 |
1 files changed, 0 insertions, 107 deletions
diff --git a/Zend/RFCs/004.txt b/Zend/RFCs/004.txt deleted file mode 100644 index 1e120ce306..0000000000 --- a/Zend/RFCs/004.txt +++ /dev/null @@ -1,107 +0,0 @@ -Title: Delegation - (a/k/a. Object-Based Inheritance) -Version: $Revision$ -Status: draft -Maintainer: Sebastian Bergmann <sb@sebastian-bergmann.de> - - -Dynamic Delegation - - Syntax / Example - - <?php - class aDelegatee { - function doSomething() { - echo 'hubu'; - } - } - - class anotherDelegatee { - function doSomething() { - echo 'tubu'; - } - } - - class Foo { - delegatee $bar; - - function setDelegatee($delegatee) { - $this->delegatee = $delegatee; - } - } - - $foo = new Foo; - - $foo->setDelegatee(new aDelegatee); - $foo->doSomething(); /* prints "hubu" */ - - $foo->setDelegatee(new anotherDelegatee); - $foo->doSomething(); /* prints "tubu" */ - ?> - - Semantics / Synopsis - - The "Foo" class may use all methods available in "$bar" as if they - where locally defined or inherited from a superclass. The essential - difference is that by assigning another object to "$bar" it is - possible to dynamically switch between different implementations for - these methods. - - -Fixed Delegation - - Syntax / Example - - <?php - class aDelegatee { - function doSomething() { - echo 'hubu'; - } - } - - class Foo { - final delegatee $bar = new aDelegatee; - } - - $foo = new Foo; - - $foo->doSomething(); /* prints "hubu" */ - ?> - - Semantics / Synopsis - - The "Foo" class may use all methods available in "$bar" as if they - where locally defined or inherited from a superclass. The difference - to the dynamic delegation is that once the delegatee object is set, - it cannot be changed. - - -Default Delegation - - Syntax / Example - - <?php - class Foo { - function __delegate($name, $parameters = array()) { - echo $name; - } - } - - $foo = new Foo; - $foo->bar(); /* prints "bar" */ - ?> - - Semantics / Synopsis - - If a class has a __delegate() method, it is called whenever a - method on an object of this class is called that is - - * Not defined in the class. - - * Not provided by a delegatee object. - - The __delegate() method is called with the name and parameters - of the method call. - - This supersedes / obsoletes similar functionality introduced in - Zend Engine 1 by ext/overload. |