Implementing Policies in .Net (Another Template vs. Generic Episode)
I just wrote an article about the need for static class interface, and why C++/CLI is (almost) the only language that (will) support compile-time polymorphism. If you are familiar with the GOF Strategy pattern, you know that it lets you change an algorithm without breaking the Open/Closed principle (OCP). A Policy is like Strategy, but instead of runtime late-binding polymorphism, it uses compile-time polymorphism and the resulting code is a hard coded call to the specific policy implementation. Read the article to find out how to implement Policy in C# and in C++/CLI and why a static class interface is a must.