By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,086 Members | 1,919 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,086 IT Pros & Developers. It's quick & easy.

the Strategy Pattern in PHP 5

P: n/a
I'm almost done my series of design patterns using PHP 5. Today's
pattern is the Strategy Pattern.

http://www.fluffycat.com/PHP-Design-Patterns/Strategy/

In the Stratedy Pattern a "family of algorythms" is used interchangably
by calling clients.

This is the second pattern in as many days as I've used my older work
with patterns in Java, and again I liked the old example when I first
looked at it, but now I wonder about it. In this example the context
is passed a parameter at instantiation, and the context then chooses a
concrete strategy which it hold on to for every time it needs a
strategy. This means that the calling client would need to call the
appropriate context. Not sure if this is the real intent here, might
have to revisit this one...

Aug 29 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.