here are 5 important uses of delegates:- 1. Abstract and - TopicsExpress



          

here are 5 important uses of delegates:- 1. Abstract and encapsulate a method (Anonymous invocation) This is the most important use of delegates; it helps us to define an abstract pointer which can point to methods and functions. The same abstract delegate can be later used to point to that type of functions and methods. 2. Callback mechanismMany times we would like to provide a call back mechanism. Delegates can be passed to the destination and destination can use the same delegate pointer to make callbacks. 3. Asynchronous processingBy using ‘BeginInvoke’ and ‘EndInvoke’ we can call delegates asynchronously. 4. Multicasting - Sequential processing Some time we would like to call some methods in a sequential manner which can be done by using multicast delegate. 5. Events - Publisher subscriber model.We can use events to create a pure publisher / subscriber model.
Posted on: Thu, 27 Jun 2013 18:42:07 +0000

Trending Topics



Recently Viewed Topics




© 2015