Delegation is a powerful mechanism through which you delegate a task from one class to another. This has the main advantage that the changes in one of your classes will not be cascaded down or into any others.
Also, if you don't get this principle, your classes are probably doing more than they should. By this, I mean that you get one class to do something that is probably best encapsulated in another, and then you can use delegation to do the same.
source
share