Tests should be ready by Tuesday
Discuss topics from Chapter 16
- classes
- prototypes
- inheritance
- encapsulation
- polymorphism
Another view, from Wikipedia entry fro Object Oriented, http://en.wikipedia.org/wiki/Object_oriented#Fundamental_features_and_concepts
“Benjamin C. Pierce and some other researchers view as futile any attempt to distill OOP to a minimal set of features. He nonetheless identifies fundamental features that support the OOP programming style in most object-oriented languages:[14]
- Dynamic dispatch – when a method is invoked on an object, the object itself determines what code gets executed by looking up the method at run time in a table associated with the object. This feature distinguishes an object from an abstract data type (or module), which has a fixed (static) implementation of the operations for all instances. It is a programming methodology that gives modular component development while at the same time being very efficient.
- Encapsulation (or multi-methods, in which case the state is kept separate)
- Subtype polymorphism
- Object inheritance (or delegation)
- Open recursion – a special variable (syntactically it may be a keyword), usually called
thisorself, that allows a method body to invoke another method body of the same object. This variable is late-bound; it allows a method defined in one class to invoke another method that is defined later, in some subclass thereof.”
Two examples of dynamic dispatch
What are desirable characteristics of a programming language?
Videos:
A few examples of exception handling
Handout with exception examples.
For next class:
- Read Chapter 17 of the text,
- Read “Lisp: Good News, Bad News, How to Win Big“, Richard P. Gabriel, 1991