This wording seems a bit confusing, but can be illustrated by example. Suppose someone designed a button control that would like to provide a notification when it was pressed. A common practice would be for the button to maintain a list of delegates to call. If a class would like a button to call one of its methods on the instance itself, it can easily build a delegate that will call this method on that instance. Note that using a delegate for this purpose means that you need to create a heap object for the delegate in addition to the instance whose method the delegate should call.
An alternative approach would be to define the INotifyOfButtonClick interface using the NotifyOfButtonClick() method, and control the buttons to save the INotifyButtonClick list. When a button is clicked, it will call NotifyOfButtonClick() for each instance. If the form has only one button that uses this interface, or if all such buttons use the same method, the form can implement INotifyOfButtonClick() itself and add itself to the list of subscription to the button (s), instead of creating a separate delegate to call his method. In scenarios where this approach works, it may be more efficient than using delegates. If there are two buttons on the form that use the same interface, but, however, want to call different methods, things get complicated. In this case, it would be necessary for the form to create a new object, the purpose of which was to implement INotifyOfButtonClick() by calling some method in the form to which it contains a link. Using such wrapper objects is likely to produce performance comparable to delegates, but without the involvement of some delegates providing the compiler.
By the way, if Microsoft can add a nested IInvoke interface to each delegate (for example, Action<int> will determine the Action<int>.IInvoke ), then if the methods that took Action<int> were overwritten to accept Action<int>.IInvoke , then objects that had only one method, which was supposed to be called by such delegates, could simply go to such methods. This feature can improve closing efficiency.
source share