Author: you've been HAACKED | Posted on: 6/18/2008 4:52:13 PM | Views : 866

When approaching an extensibility model, I often find cases in which I want to merely tweak the existing behavior of the default implementation and wish I didn�t have to create a whole new specific type to do so. Instead of creating a specific type, I tend to write a decorator class that implements the interface and takes in both the default instance of that interface and a delegate (specified using a lambda of course). Let�s look at a quick example to make all this abstract talk more concrete. I�m playing around with the NVelocity View Engine for ASP.NET MVC from the MvcContrib project . Rather than have each controller specify the view engine, I�d really like to specify this in just one place. I could take the time to setup a DI container...(read more) ...

Go to the complete details ...