Pattern Focus: Strategy Pattern using delegates
Posted by: Patrik Löwendahls shout,
on 09 Feb 2007 |
View original | Bookmarked: 0 time(s)
Interfaces are the classical way of implementing the strategy pattern, but with .NET we get another similar approach to technically accomplish the same thing. That is by utilizing delegates as part of our parameters list and C# anonymous delegates as our vessel for the strategy.The first ever discussion I had with Erik Drnenburg (http://www.doernenburg.com/) was about delegates, he categorized them as a template interface with one method. While this is not true to a full extent, since they...