Re: Interfaces and Events
- From: Jon Skeet [C# MVP] <skeet@xxxxxxxxx>
- Date: Tue, 21 Feb 2006 18:40:22 -0000
Pete Davis <pdavis68@[nospam]hotmail.com> 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?
Not particularly - it's just not something I see that often.
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.
Those all seem like perfectly good examples. There's nothing wrong with
them at all - it's just not that common. For instance, I don't think
there are very many interfaces in the framework that specify events.
(Of course, now I'll find there are hundreds...)
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.
- References:
- Interfaces and Events
- From: goodoldave
- Re: Interfaces and Events
- From: Jon Skeet [C# MVP]
- Re: Interfaces and Events
- From: Pete Davis
- Interfaces and Events
- Prev by Date: Re: Interfaces and Events
- Next by Date: Re: missing out braces
- Previous by thread: Re: Interfaces and Events
- Next by thread: What is the best way to distribute an app that uses Sql Server Express?
- Index(es):
Relevant Pages
|