A delegate is an object that know how to call a method.
A delegate is similar to a callback, a general term that captures construcs such as C function pointers.
A delegate design might be a better choice than an interface design if one or more of these conditions are true:
- The interfac defines only a single method
- Multicast capability is needed
- The subscriber needs to implement the interface multiple times
Leave a Reply