Chapter 4 Revison
Chapter 4 Revison
Chapter 4 Revison
A superclass is the superior or more general class. UML class diagram notation
uses a triangle that points to the superclass to show a
generalization/specialization hierarchy
Subclasses are the subordinate or more specialized class.
An abstract class describes a category or set of objects that never includes
individual objects or instances. It exists so subclasses can inherit from it
A concrete class allows individual objects or instances to exist. It contains actual
objects.
QUESTION: WHAT IS A WHOLE PART RELATIONSHIP, AND WHY DOES IT
SHOW MULTIPLICITY?
A whole part relationship between classes has one class that is a part or
component portion of another class.
There are 2 types of whole part relationships:
1. Aggregation: a type of whole part relationship between aggregates and its
components, where the parts can exist separately
2. Composition: A whole part relationship that are even stronger with the
parts, once associated with, can no longer exist separately.
These types of relationships allow the analyst to express distinctions about
associations among classes.
Multiplicity can apply such as when a computer has one or more storage devices.
QUESTION: COMPARE AGGREGATION AND COMPOSITION
Aggregation is a type of whole part relationship in which the component parts
also exist as individual objects apart from the aggregate.
Composition is the type of whole part relationship where the component parts
cannot exist as individual objects apart from the total composition.
A state machine diagram shows the life of an object in states and transitions.
A state machine diagram is composed of rounded rectangles representing the
states of an object and arrows representing the transitions.
The starting point of a state machine diagram is called the pseudostate
indicated by a black dot. The first shape after the dot is the first state of the
object.
It then transitions to a new state called the transition state - the state to which
an object moves after the completion of a transition.
A transition begins with an arrow from the origin state – the original state of an
object from which the transition occurs.
Transition name - the name of a message event that triggers the transition
and causes the object to leave the origin state.
Guard condition – a true / false test to see whether the transition can fire.
The forward slash divides the firing mechanism from the actions or
processes.
Action-expressions – indicate some process that must occur before the
transition is completed and the object arrives in the destination state
A composite state is a state containing other states and transitions. It
represents a higher level of abstraction and can contain listed states and
transition parts.
Sometimes an object will be in two states at the same time. For example, a
printer can be on and be printing or on idle.
The condition of being in more than one state at a time is called concurrency or
concurrent states.
When there are several states in a path that are parallel to another state, we say
those are concurrent paths.