Delegates and Events in C#
Posted
by hakanbilge
on ASP.net Weblogs
See other posts from ASP.net Weblogs
or by hakanbilge
Published on Mon, 15 Mar 2010 20:55:00 GMT
Indexed on
2010/03/15
20:59 UTC
Read the original article
Hit count: 618
Events and their underlying mechanism "Delegates" are very powerful tools of a developer and Event Driven Programming is one of the main Programming Paradigms. Its wiki definition is "event-driven programming or event-based programming is a programming paradigm in which the flow of the program is determined by events?i.e., sensor outputs or user actions (mouse clicks, key presses) or messages from other programs or threads." That means, your program can go its own way sequentially and in the case of anything that requires attention is done (when an event fires) by somebody or something, you can response it by using that event's controller method (this mechanism is like interrupt driven programming in embedded systems). There are many real world scenarios for events, for example, ASP.NET uses events to catch a click on a button or in your app, controller has notice of a change in UI by handling events exposed by view (in MVC pattern).
Delegates in C#
C# delegates correspond to function pointers in [read more....]
© ASP.net Weblogs or respective owner