Sunday, October 14, 2007

Example of Strategy Pattern

After learning about the strategy pattern, I started to think about where I have already seen this design pattern implemented before. I then realized that Patrick Falls' senior project for CMSI 402, Project M.O.S.A.I.C., is a perfect example of the strategy pattern. Patrick's project was basically a utility that used algorithms for creating mosaic like images that start with an actual image and proceed to recreate that image in the style of a mosaic by using other images as tiles. The feature of Patrick's project that used the strategy pattern was the ability to use pluggable algorithms that a user may choose on the fly. These algorithms are encapsulated as an object that can be interchanged.

1 comment:

Dondi said...

OK, that's a good find, but keep it coming...you have until October 23. Six more of these, OK? Preferably one for each pattern I've given you.