I learn Delegation pattern from here: http://en.wikipedia.org/wiki/Delegation_pattern
It confused me as follow:
- Delegation Pattern == Method Overloading / Overriding
- Delegation Pattern == Polymorphism
Is any of above true?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not really.
In a simple java example Object A has a method that turns around and calls a method on Object B. So you can say that A delegated to B.
In a complex example Object B implements Interface A but you can ask an interface A to perform a method and it will tell B to perform that method.
None of this really have much to do with polymorphism or overriding.