Re: How to tell if an interface method has been implemented
- From: Oliver Sturm <oliver@xxxxxxxxxxxx>
- Date: Fri, 26 Aug 2005 12:47:20 +0100
Jon Skeet [C# MVP] wrote:
It would take more time if you had to do it every time, yes. You'd want to cache that information - indeed, you might end up putting objects which only had stub implementations into a different collection, etc. It all depends on the situation.
I have never tested anything like this, but I imagine the time to call an empty method to be extremely small - if the compiler doesn't optimize away the call to begin with. I guess if you were going to use a single bool flag per method and just checked it on later calls, you might save some time. But as soon as any kind of more complicated lookup comes into play, such as using collections of any kind, I can't believe you'll actually save time compared to just calling the method.
Anyway, it's again one of these things: I'd just call the method, unless the profiler shows me that this is a bad idea.
Oliver Sturm -- omnibus ex nihilo ducendis sufficit unum Spaces inserted to prevent google email destruction: MSN oliver @ sturmnet.org Jabber sturm @ amessage.de ICQ 27142619 http://www.sturmnet.org/blog .
- Follow-Ups:
- Re: How to tell if an interface method has been implemented
- From: Chris Dunaway
- Re: How to tell if an interface method has been implemented
- References:
- How to tell if an interface method has been implemented
- From: Chris Dunaway
- Re: How to tell if an interface method has been implemented
- From: Jon Skeet [C# MVP]
- Re: How to tell if an interface method has been implemented
- From: Oliver Sturm
- Re: How to tell if an interface method has been implemented
- From: Jon Skeet [C# MVP]
- How to tell if an interface method has been implemented
- Prev by Date: Re: List SQL servers in a network
- Next by Date: browser session handling
- Previous by thread: Re: How to tell if an interface method has been implemented
- Next by thread: Re: How to tell if an interface method has been implemented
- Index(es):
Relevant Pages
|