Delegating Decorators
Posted by: youve been HAACKED,
on 18 Jun 2008 |
View original | Bookmarked: 0 time(s)
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 didnt 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). Lets look at a quick example to make all this abstract talk more concrete. Im...