CSC/ECE 517 Summer 2008/wiki2 8 jb: Difference between revisions
Jump to navigation
Jump to search
Line 2: | Line 2: | ||
==Background== | ==Background== | ||
An in-depth description [http://en.wikipedia.org/wiki/Inheritance_(computer_science) Inheritance] and [http://en.wikipedia.org/wiki/Delegation_(programming) 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=== | ||
[http://en.wikipedia.org/wiki/Inheritance_(computer_science) Inheritance] is one of the fundamental tenets of [http://en.wikipedia.org/wiki/Object-oriented_programming object oriented programming]. Inheritance refers to the ability to model hierarchies classes that are related to each other through the [http://en.wikipedia.org/wiki/Is-a is-a] relationship. | |||
[http://en.wikipedia.org/wiki/Inheritance_(computer_science) Inheritance] | |||
===Delegation=== | ===Delegation=== | ||
[http://en.wikipedia.org/wiki/Delegation_(programming) Delegation], also known as [http://en.wikipedia.org/wiki/Object_composition#Aggregation aggregation], refers to the ability model the situation where classes contain instances of, or references to, other classes, and use these classes to <i>delegate</i> responsibilities to. | |||
[http://en.wikipedia.org/wiki/Delegation_(programming) Delegation] | |||
==Inheritance vs. Delegation== | ==Inheritance vs. Delegation== |
Revision as of 18:52, 20 June 2008
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.