8.2 Prepare a data dictionary
Write down a paragraph precisely describing each object class.
Describe the scope of the class within the current problem
including any assumptions or restrictions on its membership or use.
The data dictionary also describes attributes, associations and
operations.8.3 Identify associations
Any dependency between two or more classes is an association. A
reference from one class to another is an association. Associations
often correspond to stative verbs or verb phrases. These include
physical location, directed actions, communication, ownership, or
satisfaction of some condition. Extract all the candidates from the
problem statement and get hem down on paper.
Don't spend much time trying to distinguish between association
and aggregation. Aggregation is just an association with
extra conditions.
Now discard unnecessary and incorrect associations, using the
following criteria:
Further specify the semantics of associations as follows:
If one of the classes in the association has been eliminated, then the association must be eliminated or restated in terms of other classes.
Eliminate any associations that are outside the problem domain or deal with implementation contructs.
An association should describe a structural property of the application domain. Eliminate associations that describe a transient event.
Try to decompose associations between three or more classes in binary associations, or phrase them as qualified associations. If a term in a ternary association is purely descriptive and has no features of its own, then the term is a link attribute on a binary
association.
Omit associations that can be defined in terms of other associations because they are redundant. Also omit associations defined by conditions on object attributes.
Name the associations correctly: don't say how or why a situation came about, say what it is. (names of associations should be structural, not events or actions)
Add role names where appropriate. If there is only one association between a pair of classes, and the name of a class
adequately describes its role, you may omit role names.
Specify multiplicity, but don't put too much effort into getting it right, as multiplicity often changes during analysis. Challenge multiplicity values of "one".
Add qualifiers where necessary, to distingsuish the objects on the many side of an association.
Add any missing associations that are discovered
8.4 Identify attributes of objects and links
Attributes are properties of individual objects, such as name,
weight, velocity, or color. Attributes should not be objects; use an
association to show any relationship between two objects.
Attributes usually correspond to nouns followed by possessive
phrases, such as "the color of the car", or adjectives. Attributes are
not likely to be fully described in the problem statement, so you
must draw on your knowledge of the application domain and the
real world to find them. Get the most important attributes first. Fine
details can be added later. Avoid attributes which are solely for
implementation. Be sure to give each attribute a meaningful name.
Derived attributes (e.g. "age") should be omitted or clearly labelled.
Link attributes should also be identified.
After identifying the candidate attributes, eliminate unnecessary and
incorrect attributes with the following criteria:
If the independent existence of an entity is important, rather than just its value, then it is an object;
If the value of an attribute depends on a particular context, then consider restating the attribute as a qualifier;
Identifiers must exist in the problem-domain, implementation-identifiers should not be listed as attributes.
If a property depends on the presence of a link, then the property is an attribute of the link and not of a related object
If an attribute describes the internal state of an object that is invisible outside the object, then eliminate it;
Omit minor attributes which are unlikely to affect most operations
An attribute that seems completely different from and unrelated to all other attributes may indicate a class that should be split into two distinct classes
8.5 Organize and simplify object classes using inheritance
Inheritance can be be added in two different ways:
Multiple inheritance may be used to increase sharing, but only if
necessary, because it increases both conceptual and
implementation complexity.
You can discover inheritance from the bottom up by searching for
classes with similar attributes, associations, or operations. For each
generalization, define a superclass to share common features. Some
attributes or even classes may have to be redefined slightly to fit in
properly (this is acceptable, but don't push too hard if it doesn't fit,
you may have the wrong generalization). Some generalizations will
suggest themselves based on an existing taxonomy in the real
world; use existing concepts whenever possible.
Attributes and associations must be assigned to the most general
class for which it is appropriate. Some adjustment might be
necessary to get it right.8.6 Verify that access paths exist for likely queries
Trace access paths through the object model diagram to see if they
yield sensible results. Ask the following questions:
Change the model whenever the answer to one of these questions
is "no". Where a unique value is expected, is there a path yielding a unique result?
For multiplicity "many", is there a way to pick out unique values when needed?
Think of questions you might want to ask, are their useful questions which cannot be answered? They indicate missing
information.
8.7 Iterate and refine the model
An object model is rarely correct after a single pass. If a deficiency
is found, go back to an earlier stage if necessary to correct it. Some
refinements can only come after the dynamic and functional
models are completed.
Signs of missing objects include:
A sign of an unnecessary class is, for example, a lack of attributes,
operations, and associations on a class. An operation with no target class: add the missing target class
Duplicate associations with the same name and purpose: generalize to create the missing superclass that unites them.
A sign of a missing association is a missing access path for an
operation: add new associations so that queries can be
answered.
Signs of unnecessary associations are:
Redundant information in the associations: remove associations that do not add new information or mark them as derived.
Lack of operations that traverse an association (you can only remove associations because of this reason after you specified the operations)
8.8 Group classes in modules
Diagrams may be divided into sheets of uniform size for
convenience in drawing, printing and viewing. Tightly coupled
classes should be grouped together, but since a sheet holds a fixed
amount of information the breakdown is occasionally arbitrary. A
module is a set of classes (one or more sheets) that captures some
logical subset of the entire model.
Each association should generally be shown on a single sheet, but
some classes must be shown more than once to connect different
sheets. You should try to minimize the number of this so-called
"bridge-classes".
Last modified: February 8th, 1996