Zeev Suraski wrote:
> able to switch aggregated objects after instantiation is not very
> helpful IMHO.
Strategy Design Pattern
<?php
class aStrategy {
// ...
}
class anotherStrategy {
// ...
}
class Foo {
delegatee $strategy;
function setStrategy($strategy) {
$this->strategy = $strategy;
}
}
?>
This way, an object of Foo can dynamically change behaviour in a very
elegant way.
--
Sebastian Bergmann
http://sebastian-bergmann.de/ http://phpOpenTracker.de/
Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php