Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007
Discussion 4 - William Lee
Definitions (Summer 2003)
1. Inheritence is subclasses of a parent class possessing the same attributes/services of
their parent class. For example, if you have a class Car that can drive, and you have
subclasses ToyotaCar, FordCar, GMCar, even though these subclasses have specialized
functions, they all inherit the parent's ability to drive (all Cars drive). They all have
an IsA relationship with Car.
2. Delegation is giving another class (or classes) the responsibility to perform tasks.
For example, a Clock object giving Time the responsibility of calculating and returning the
correct time for Clock to display.
3. Polymorphism (many forms) is the idea of similar methods performing similar
functions on different code. For example, if you have classes Dog, Cat, and Bird, calling
a method named talk(), they return 'woof,' 'meow,' and 'tweet' respectively.
4. Encapsulation is the idea that objects have their own separate data, methods, etc.
Such data cannot be accessed or manipulated directly by other objects. For example, I have
two instances of JarOfMarbles. Each JarOfMarbles knows how many marbles it contains, can
increment and decrement it, etc., but neither knows the number of marbles in the other, nor
can they increment or decrement the marbles in the other jar (unless they go through a
public method to do so).
5. MVC (Model-View-Controller) separates the model (backend programming that models the
world) from the view (what the user sees–the interface). The controller facilitates the
interaction of the model with the view, and it is best that the model and view know as
little about each other as possible. That way, if models or views have to be changed or
swapped, the other component does not have to be extensively modified. A good example was
the UI we built in class for our Clock. The third attempt had Clock and its interface
largely independent of one another.
Link to this Page