Link Details

Link 90252 thumbnail
User 225256 avatar

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.
  • 18
  • 0
  • 1390
  • 540

Comments

Add your comment
User 283139 avatar

ceaseoleo replied ago:

0 votes Vote down Vote up Reply

i like the example and a good read for a very necessary pattern.

User 204084 avatar

kenman replied ago:

0 votes Vote down Vote up Reply

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.

User 247182 avatar

David Cumps replied ago:

0 votes Vote down Vote up Reply

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

User 204084 avatar

kenman replied ago:

0 votes Vote down Vote up Reply

Kudos, reinforcing your studies by putting it into practice - and putting it into your own words - is a great way to learn.

User 247182 avatar

David Cumps replied ago:

0 votes Vote down Vote up Reply

Thanks, and as promised, just finished my Observer Pattern post :) (http://www.dzone.com/links/design_patterns_observer_pattern.html)

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.