Test yourself: run through the following list of OO terms—some formal, some informal—and see whether you can define each term in your own words without referring to the text:
Abstract class | Class | Derived class |
Abstract method | Class hierarchy | Dictionary |
Abstraction | Class variable | Encapsulation |
Accessor (of a property) | Classification | Field |
Accessor method | Client (object) | Generalization |
Aggregation | Client code | Generic class |
Ancestor class | Collection class | Get accessor |
Association | Composite class | Get method |
Base class | Constant | Getter |
Behavioral relationship | Constructor | Information hiding |
Binary association | Delegation | Inheritance |
Instance | Operation | Set method |
Instance variable | Ordered list | Setter |
Instantiation | Overloading | Sibling class |
Interface | Overriding | Simple type |
Local variable | Parent class | Sorted ordered list |
Leaf node | Polymorphism | Specialization |
Link | Predefined type | State |
Member | Private accessibility | Static field |
Method | Public accessibility | Static method |
Method header | Reference | Static variable |
Method signature | Reference variable | Structural relationship |
Modeling | Reflexive association | Supplier (object) |
Multiple inheritance | Root (of a class hierarchy) | Unary association |
Multiplicity | Set (collection) | User-defined type |
Object (in the software sense) | Set accessor |
Which fields, belonging to which SRS classes, might be well suited to being declared as static?
It has been argued that the capability to declare and implement interfaces in the C# language eliminates the need for derived classes to inherit from multiple base classes. Do you agree or disagree? Why? Can you think of any ways in which implementing multiple interfaces "falls short" as compared with true multiple inheritance?
The following client code scenarios would each cause compilation errors—can you explain why this is so in each case? Be as precise as possible as to the reasons—they might not be as obvious as first meets the eye!
Assume that Professor and StudentTeacher are both classes that implement the ITeacher interface.
Scenario #1:
Professor p; StudentTeacher s = new StudentTeacher(); ITeacher t; t = s; p = t;
Scenario #2:
Professor p = new Professor(); StudentTeacher s; ITeacher t = new StudentTeacher(); s = t;
Scenario #3:
Professor p = new Professor(); StudentTeacher s = new StudentTeacher(); ITeacher t; p = t;