McConnell_2004_CH06_Working_Classes Flashcards
An Abstract Data Type is…?
is a collection of data and operations that work on the data. The operations both describe the data to the rest of the program and allow the rest of the program to change the data.
List 8 Benefits of using ADTs…?
- You can hide implementations:
- Changes don’t affect the whole program:
- You can make the interface more informative:
- It’s easier to improve performance:
- The program is more obviously correct:
- The program becomes more self-documenting:
- You don’t have to pass data all over your program:
- You’re able to work with real-world entities rather than with low-level implementation structures:
What is the ‘semantic’ part of a routine…?
The semantic part of the interfaces consists of assumptions about how the interface will be used, which cannot be enforced by the compiler.
What is containment…?
Containment ("has a" Relationships) Containment is the simple idea that a class contains a primitive data element or object.
State the Liskov Substitution Principle…?
In one of object-orientated programming’s seminal papers, Barbra Liskov argued that you shouldn’t inherit from a base class unless the derived class truly “is a” more specific version of the base class . Andy Hunt and Dave Thomas summarize LSP like this “Subclasses the difference”.
In other words, all the routines defined in the base class should mean the same thing when they’re used in each of the derived classes.
Why must inheritance be used with great care? pg 149
Inheritance tends to work against the primary technical imperative you have as a programmer, which is to manage complexity.
For the sake of controlling complexity, you should maintain a heavy bias against inheritance.
How does a Package differ from a Class…?
p 156 to 157
(?????)