Er. alokpandey's Blog

Why should we use delegates?

Posted in Uncategorized by Alok Kumar Pandey on February 25, 2011

“Delegates are like function pointers of C++. They reference methods that can be executed using delegates. A method can also be called using class object. So what is the advantage of using delegates? What can a delegate do that a normal function call cannot?”

Major Advantages:

i. Encapsulating the method’s call from caller.
ii. Effective use of Delegat improves the performance of application.
iii. Used to call a method asynchronously.
iv. Can be used in Multi Threaded application.

In a place where threads are being used and there is no direct way to call the methods inside a thread in that case we may make use of a delegated because using that we can call any methods inside a running thread too.

Advertisements
Tagged with: ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: