An interesting pattern I've seen emerge since the early releases of Orcas is what I might refer to as "delegate properties". What I mean by that is a property (or field, I suppose) that returns a delegate. This pattern has some interesting implications.
First, in a language that treats delegates as directly callable objects, this pattern looks just like a method (someInstance.TheProperty(args)). You can't tell the difference (although VS gives you different intellisense) by looking at a callsite like this. Among other things, this leads to some interesting naming issues. Do you name it like you would a method?
Second, it opens up opportunities to do some really powerful (and slightly insane) hybrid inheritance models. Think about a virtual delegate property that has both a getter and a setter, now think about trying to predict what that delegate will do when you call it. It doesn't sound like something to recommend as part of a public API, but I think there are some interesting scenarios there.
If I come up with something interesting and useful, I'll let you know.
Remember Me
Page rendered at Monday, January 05, 2009 8:45:42 PM (Pacific Standard Time, UTC-08:00)
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.