Chapter 12 Flashcards
What must any OOP language support?
ADT
Inheritance
Polymorphism
Why is Inheritance needed?
Can increase productivity (reuse)
What are some OO concepts?
ADT (classes)
class instances (objects)
class that inherits (derived/subclass)
parent class
subprograms defining operations on objects (methods)
Calls to methods (messages)
collection of an object’s methods (message protocol/interface)
2 parts in message (method name, dest object)
What are the 2 kinds of variables in a class?
Class variables (one per class)
Instance variables (one per object)
same for methods
What is Dynamic binding?
Polymorphic reference (pointer)
When everything is an object what are the advantages and disadv?
Adv: elegance
Disadv: slow
When you add objects to a complete typing system what happens?
Speed up simple operations
Results in confusing type system
When using an imperative typing system for primitives and make everything else object what happens?
Simple operations can be fast but typing system remains small
but 2 type systems has to mix
What does dynamic binding look like in C++?
virtual key word, interface in java