przygotowuje się do egzaminu na "Zend PHP5 Certyfication". Jedno z pytań na które dziś trafiłem w Voucherze to
Consider the following series of classes and interfaces
<?php interface MyInterface { public function getTitleAndAuthor(); } class MyClass { private $_author; private $_title; public function getAuthor() { return $this->_author; } public function getTitle() { return $this->_title; } } class MyClass2 { private $_instance; public function __construct(MyClass $a) { $this->_instance = $a; } public function getTitleAndAuthor() { 'title' => $this->_instance->getTitle(), 'author' => $this->_instance->getAuthor() ); return $retval; } } class MyClass3 { public function doSomething(MyInterface $instance) { $value = $instance->getTitleAndAuthor(); } } ?>
MyClass2 is an example of the ________ design pattern.
Jaką odpowiedź byście udzielili??