C # differences between delegate and direct call Methods

Source: Internet
Author: User

Delegate has the following advantages over direct call:

1. It is equivalent to using the method as another method parameter (similar to the function pointer of C)
2. serve as a bridge between two methods that cannot be called directly. For example, delegate is required for cross-thread method calls in multiple threads.
3. Use delegation when you do not know the specific implementation of the method. For example, use delegation in an event.
4. Decoupling

 

Reference link:

Http://developer.51cto.com/art/200908/147016.htm

Http://wenwen.soso.com/z/q148429684.htm

Http://www.cnblogs.com/JimmyZhang/archive/2007/09/23/903360.html

Http://bbs.csdn.net/topics/390244872

Http://www.sharejs.com/codes/csharp/6331

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.