Want better links on DZone? We do, too! Login and vote now.
By mswatcher
via blog.cumps.be
Published: Jun 25 2008 / 22:59
The first pattern I want to talk about is the Strategy pattern, which always reminds me about the Command & Conquer games so I’ll simply use it as an example :)
First of all, the definition: “Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it.
SaveShareSend
Tags: frameworks, usability
Comments
ceaseoleo replied ago:
i like the example and a good read for a very necessary pattern.
kenman replied ago:
The example reminds me ALOT of the samples used by Matt Zandstra in "PHP Objects, Patterns, and Practice", found here: http://www.apress.com/book/view/9781590599099
I've loaned the book out (I thought it was a good book), or else I could check the examples closer.
If the author of this article did in fact write the samples on his own merits, then please forgive me for thinking otherwise.
David Cumps replied ago:
I invented them myself, I haven't read a book in like 5 years or something ;) Never even heard about that other one.
I'm reading Head First - Design Patterns now, and read a chapter per day, and the day afterwards I'm trying it out and explaining it in my own words to learn it :) Ideas are just brewing in my head during the day, just like I'm now thinking on which content I'll add for the next pattern (observer pattern) :p
Greets,
David
kenman replied ago:
Kudos, reinforcing your studies by putting it into practice - and putting it into your own words - is a great way to learn.
David Cumps replied ago:
Thanks, and as promised, just finished my Observer Pattern post :) (http://www.dzone.com/links/design_patterns_observer_pattern.html)
Voters For This Link (18)
Voters Against This Link (0)