Re: Interfaces and Events




"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


.



Relevant Pages

  • Re: Interfaces and Events
    ... It's not terribly common, but it makes sense in certain situations. ... reusable plugin framework, but can't seem to accomplish this). ... I'll create interfaces which are implemented in the main app, ... there are very many interfaces in the framework that specify events. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Interfaces and Events
    ... Think all the plugin needs is the expected Message type. ... |> You can certainly include events within interfaces. ... |> It's not terribly common, but it makes sense in certain situations. ... | triggered for things such as initialization completing, app shutting down, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: how to copy live paradox tables
    ... from this common table. ... automatically make an entry into a common table which is located in the ... these entries are added or deleted from this common table. ... if a user would somehow quit their Paradox app in an unorthodox ...
    (comp.databases.paradox)
  • Re: Problems with AppData on Vista.
    ... The 2nd user that comes along and attempts to read/write the common data ... security APIs for a loong time. ... pragmatic - I needed my app to deploy and run on 95/98/ME. ... App vista compatible however is turning out to be a PITA. ...
    (microsoft.public.platformsdk.security)
  • Re: Architectural feedback
    ... The skeleton's not too far off of the general picture I've been thinking. ... Just to make sure we're clear, when you mention interfaces, do you mean (I'm ... > for this app? ... >> core app must reside on the client or may be run from the server. ...
    (microsoft.public.dotnet.general)