views:

94

answers:

1

Hi. How do you call this design pattern?

class Foo {
   protected $delegates = array();
   //...
   public function __call($method,$argv) {
      //call $this->$something->$method($argv), where $something is a mapping from $this->delegates
   }
}

I can speculate, but I'm not sure, so I wanted to ask you.

+2  A: 

The aptly named Delegation pattern?

Amber
Are you saying that only because the member's name, or did I really named it right? :)
Flavius
Because you used the word 'delegates' in your example. :)
Amber
Could someone confirm? I don't trust my naming convention :-)
Flavius
Oh, I misread what you were asking. Click the name in my reply, and you'll see that it leads to the Wikipedia page specifically about the pattern; it's definitely the correct name.
Amber