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

Spring2004 Midterm Review: Definitions

1. Inheritance - where structure and behavior are passed on from some objects to others. (p5)
2. Delegation -
The activity of asking another object to perform a service for the original object receiving the message, is called delegation (p 84).

3. Polymorphism - having the same message perform approximately the same functions on different data (p18)
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 -ellie
4. Encapsulation - the concept that objects have their own data and behaviors, and that no other object can access the data without a given object's permission (p5)
5. MVC - model, view, control (p 128). A paradigm in GUI development where there is strict separation between seeing the data (view), modifying the data (control), and the data itself (model).

C is for "controller" and it is about a little more than modifying the data. The controller is that part of the interface that receives input from the user. Various input action may simply cause a change in the view (bringing a window to the foreground) while other actions result in come interaction with the model, tyoically to change it (as when the buttons on the clock are clicked). Rich LeBlanc
1. See Box and NamedBox (p.77)
2. See Clock and Time (p.101) or Box and Pen (p.83)
3. 5 + 3 very different than 5.1 + 3.2 (p.18)
4. If there would be no accessor messages, there would be no way to get to the instance variables.

A little more descriptive answers:

1. Inheritance - When a particular class has more specific information about a certain kind of more general class, it is appropriate for that class to inherit from the general class. For example, a Car is a fairly generic class, but has common behavior that all cars share. A specific implementation of a Car, say, a BMW, while performing all the basic routines a Car can do, might do them differently than other cars, and also might have additional behaviors and attributes that not every car has.

2. Delegation - Delegation is the process of having a message delegate from one class to another, where the responsibility for the message actually lies. For example, you can start a Car, but the internal workings of a Car can delegate the start message to the Ignition, which can delegate to the Engine, etc. It wouldn't be appropriate to directly expose these internal delegations, so the Car class handles a start, and makes sure that everything that is necessary to happen for the car to start, happens.

3. Polymorphism - Polymorphism allows for inheritance to handle how specific classes implement various methods. As in the previous inheritance example, all Cars share common behavior, but different Cars may actually implement them differently. All Cars can switch gears, but the mechanism for switching gears varies based on the make and model, if the car is manual or automatic, and various other factors. The specific implementation is hidden, but is called appropriately depending on what kind of object a variable references. Polymorphism allows generic programming and ensures that the specific details work appropriately.

4. Encapsulation - Encapsulation is the idea that one can "blackbox" a class's methods and data into a single class, and not worry about how it works, just know that it does work. The specific implementation details of how certain methods behave isn't necessary for the programmer; only the end result is necessary. This keeps data hidden from outside sources, and allows the class/object itself to manage how the details work without affecting anyone else.

5. MVC - MVC stands for Model, View, and Control. This is a GUI concept where the graphical representation (view) is kept separate from the physical data (model) and the controller. This allows for various adaptations to occur without penalty. Since the data and control are independent of the view, the programmer can switch one view out for another, without affecting the other two areas of the program. Similarly, the data or the control sides can be switched out too, allowing for a very modular program (very much in the spirit of OO).

Link to this Page