callback or event?

  • Thread starter Thread starter David
  • Start date Start date
D

David

I need to implement in my class something to notify events to the
application.

I must focus in the performance, so maybe you can tell me if is better to
implement a event or a callback (using delegate directly)


Thanks
 
Assume this is VB.NET? Whether you use event keyword or directly wire your
callback via an explicit delegate, you will end up with the same IL (or
nearly so), so I am not sure either is a "better" solution.

I am personally more fond of explicitly coding delegates, but a person adept
at VB will be more used to event handling with the Event keyword. Choose
based on who will maintain.


---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
David,

Events use callbacks so you're really talking about one and the same thing.
If you want to use events then you should implement an Event.

-Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top