Posted on Wednesday January 28, 2009

C# Design patterns: the Strategy pattern


Multiple classes implement an interface, handling an algorithm in a different way.


Sorting is the clearest working example of the Strategy pattern. In .NET you’ll find it in the IComparer interface alongside Array.Sort/LINQ, see the links section for an article on this on MSDN.