View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Fall2004 Midterm Review: Definitions

1. Inheritance: The idea that a class can contain methods and variables that are not specifically defined in its blueprint but defined in the blueprint of its parent class. Ex: The class "Teacher" might not have the variable "name" but since its parent class is "Person," it inherits the name variable.
2. Delegation: action of one object asking another to perform a "service" for it. Ex: when Joe the Box now uses the Pen class to draw itself instead of having its own draw method defined.
3. Polymorphism: the ability to redefine a method to perform similarly for different classes that are derived off of a base class. Ex: triangle and square are both subclasses of the shape class, but both contain a draw method that is defined differently yet provide the same functionality.
4. Encapsulation: the idea that objects cannot mess with the data of other objects unless given permission to. In Java this is the idea of having all private variables in a class that can only be changed using modifiers.

1) Inheritence - structure and behavior of objects are passed from one object to another.

3) Polymorphism - when the same message performs the (relatively) same functions on different data. This is enabled through late-binding.

4) Encapsulation - the concept that objects have their own data and behaviors and that no other object can access the data without being given a given object's permission.

it is important to note that polymorphism is more than just inheritance & the way that the most specific method in the child class will be used. see this page for a good explanation:,,sid9_gci212803,00.html

because squeak is typeless we have more flexibility with variables. for example, we might define a variable that we give a value of a number or a string, and both Integers and Strings understand '+': e.g. 6+7=13, '6'+'7'='13'-ellie

Link to this Page