Ch 3 Flashcards
Software component
A component is an abstract entity that can perform tasks, i.e. fulfill some responsibilities.
Characteristics of a component
Two important characteristics of components are:
- A component must have a small, well-defined set of responsibilities.
- A component should interact with other components to the minimal extent possible.
The what/who cycle
First, the design team identifies what activity needs to be performed next. This is immediately followed by answering the question of who performs the action.
Behavior of a component
The behavior of a component is the set of actions it can perform. The complete description of all the behavior for a component is sometimes called the protocol.
State of a component
The state of a component represents all the information held within it at a given point of time. Notice that the state is not static and can change over time.
Cohesion
Cohesion is the degree to which the responsibilities of a single component form a meaningful unit. High cohesion is achieved by associating in a single component tasks that are related in some manner. Probably the most frequent way in which tasks are related is through the necessity to access a common data value.
Coupling
Coupling describes the relationship between software components. In general, it is desirable to reduce the amount of coupling as much as possible, since connections between software components inhibit ease of development, modification, or reuse. In particular, coupling is increased when one software component must access data values - the state - held by another component. Such situations should almost always be avoided in favor of moving a task into the list of responsibilities of the component that holds the necessary data.
Parnas’s principles (David Parnas)
- The developer of a software component must provide the intended user with all the information needed to make effective use of the services provided by the component and should provide no other information.
- The developer of a software component must be provided with all the information necessary to carry out the given responsibilities assigned to the component and should be provided with no other information.