Ch 2 Flashcards
Abstraction
Abstraction is the purposeful suppression of detail in order to emphasize a few basic features.
Information hiding
Information hiding describes the part of abstraction in which we intentionally choose to ignore some features so that we can concentrate on others.
Two important forms of abstraction
is-a and has-a abstractions
is-a
Specialization is is-a abstraction: A bicycle “is-a” wheeled vehicle, which in turn “is-a” means of transportation.
has-a
Abstraction is often combined with a division into components. E.g. we divide the automobile into the engine and transmission. Components are carefully chosen so that they encapsulate certain key features and interact with other components through a simple and fixed interface.
Division into parts is has-a abstraction. The meaning of this term is easy to understand: a car “has-a” engine, it “has-s” transmission, and so on.
Pattern
A pattern is simply a generalized description of a solution to a problem that has been observed to occur in many places and in many forms. The pattern described how the problem can be addressed and the reasons both for adopting the solution and for considering other alternatives.
Taxonomy / inheritance hierarchy
Another form of abstraction is taxonomy or inheritance hierarchy. Here the layers are more detailed representatives of a general category. An example of this type of system is a biological division into categories such as Living Thing-Animal-Mammal-Cat. Each level is a more specialized version of the other.
Coupling
Coupling refers to the extent to which one component uses another to perform actions; generally a goal is to reduce coupling between software components.
Cohesion
Cohesion refers to the extent to which the actions of a component seem to be tied together in purpose; generally a goal is to increase cohesion within a software component.