Re: Interfaces and Events

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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
.



Relevant Pages

  • Re: Modernizing Common Lisp
    ... standard supported bindings. ... models and socket abstractions that are common enough for standardization. ... hard to inject libraries to write portable code is a good thing? ... but with incompatible interfaces (sort of like the problem ...
    (comp.lang.lisp)
  • Re: Interfaces and Events
    ... You can certainly include events within interfaces. ... 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, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: [PATCH 1/3] sysfs directory scaling: rbtree for dirent name lookups
    ... but I would argue that for dynamic network ... For our case where we use up to 128K interfaces, sysctl entries per network ... interface is pretty much unusable - but I agree that is not a very common case ...
    (Linux-Kernel)
  • Re: Interface suggestions
    ... > The same goes for the common dialogs. ... > they should try to provide similar interfaces so the user does not ... > They are all tabbed dialogs. ... > another dialog (see how Display Properties uses combos). ...
    (microsoft.public.dotnet.languages.vb)
  • Re: common dialog on vista
    ... Looking at the Microsoft docs, ... what DLL houses the interfaces, which is odd, but it ... possible to have a vbscript open a Common Dialog in Vista, ... I read that in Vista it has been replaced with the Common Item Dialog, ...
    (microsoft.public.scripting.vbscript)