CSC/ECE 517 Summer 2008/wiki2 8 jb

From Expertiza_Wiki
Jump to navigation Jump to search

This wiki will explore the age old debate on inheritance vs. delegation, showing the strengths and weakness of each approach, and where each approach is preferred.

Background

An in-depth description Inheritance and Delegation is out of the scope of this wiki, but a brief description of each subject will be given to get us started.

Inheritance

Inheritance is one of the fundamental tenets of object oriented programming. Inheritance refers to the ability to model hierarchies classes that are related to each other through the is-a relationship.

Delegation

Delegation, also known as aggregation, refers to the ability model the situation where classes contain instances of, or references to, other classes, and use these classes to delegate responsibilities to.

Inheritance vs. Delegation

Links