McConnell_2004_CH06_Working_Classes Flashcards

1
Q

An Abstract Data Type is…?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

List 8 Benefits of using ADTs…?

A
  • 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:
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the ‘semantic’ part of a routine…?

A

The semantic part of the interfaces consists of assumptions about how the interface will be used, which cannot be enforced by the compiler.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is containment…?

A
Containment ("has a" Relationships)
Containment is the simple idea that a class contains a primitive data element or object.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

State the Liskov Substitution Principle…?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Why must inheritance be used with great care? pg 149

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How does a Package differ from a Class…?

p 156 to 157

A

(?????)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly