Simulating Multiple Inheritance by Delegation
page 2 of 5
by Joseph Chahine
Feedback
Average Rating: 
Views (Total / Last 10 Days): 7224/ 123

What is delegation?

As defined in the famous book "Design Patterns - Elements of Reusable Object-Oriented Software," Delegation is "a way of making composition as powerful for reuse as inheritance. In delegation, two objects are involved in handling a request: a receiving object delegates operations to its delegate. This is analogous to subclasses deferring requests to parent classes. But with inheritance, an inherited operation can always refer to the receiving object through the member variable in C++ and self in Smalltalk. To achieve the same effect with delegation, the receiver passes itself to the delegate to let the delegated operation refer to the receiver."

In short, delegation can be viewed as a relationship between objects where one object forwards (or delegate) certain method calls to another object.


View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 
Learn More
.NET Tools
asp.net shopping cart
asp.net chart control






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2008 ASPAlliance.com  |  Page Processed at 10/12/2008 4:44:07 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search