Re: Interfaces and Events
- From: "Pete Davis" <pdavis68@[nospam]hotmail.com>
- Date: Tue, 21 Feb 2006 11:58:13 -0600
"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> wrote in message
news:MPG.1e655f4975bf938798ce81@xxxxxxxxxxxxxxxxxxxxxxx
<goodoldave@xxxxxxxxx> wrote:
You can certainly include events (not delegates) within interfaces.
It's not terribly common, but it makes sense in certain situations.
Really? It's not common? I do it all the time. Is there some reason it's not
common?
To give you an example, for most of my larger apps, I have generally create
some sort of plugin framework (I'm still trying to come up with a good,
reusable plugin framework, but can't seem to accomplish this). Normally,
I'll create interfaces which are implemented in the main app, usually
something like an IApplication interface. Then I'll have events that get
triggered for things such as initialization completing, app shutting down,
windows opening or closing, or whatever.
This is simply an example. I could think of tons of others. I could
implement these as methods in the plugins and have the main app call those
methods when these events take place, but then every plugin would have to
implement the methods.
Anyway, just curious if there's something wrong with having events in
interfaces or you just don't see it very commonly.
Pete
.
- Follow-Ups:
- Re: Interfaces and Events
- From: Jon Skeet [C# MVP]
- Re: Interfaces and Events
- From: William Stacey [MVP]
- Re: Interfaces and Events
- References:
- Interfaces and Events
- From: goodoldave
- Re: Interfaces and Events
- From: Jon Skeet [C# MVP]
- Interfaces and Events
- Prev by Date: Re: Interfaces and Events
- Next by Date: Re: Deploy Crystal Report 9.
- Previous by thread: Re: Interfaces and Events
- Next by thread: Re: Interfaces and Events
- Index(es):
Relevant Pages
|