When we make an object of a class then we can access
all functions of a class and Base class functions too. Here we can see that a user can simple make an object of a class and access all information of class. But in real word this is
drawback of an object.
For example we are an account holder of a bank, and we have permission to access all information, like other account holder’s details, bank deposited details and etc. think what happens if bank provide all accessibly to account user.
Through delegate we can provide limited accessibility to the user. It behaves run-time as a class and yes it can save time, support dynamic method invocation and break accessibility of all functions. It is similar of function
pointer in c and it defines what that function looks like.Binding Events to Event Handlers is probably your first introduction to delegates.
To see live examples and know further uses of delegates i would like to refer you on these along with above links:
When would you use delegates in C#? [
^]
Delegates, Why[
^]
when & why to use delegates?[
^]
Practical Use of Delegate in real time Application -1
[
^]