OMT Object Model

8. Modelling procedure

The following steps are performed in constructing an object model:
You can find an example here.


8.1 Identify object classes

The object classes can be found following this procedure:
  1. List all candidate object classes found in the written description problem. This can be done by writing down all the nouns of the problem description.
  2. Now discard all the unnecessary and incorrect classes according to the following criteria:
    Redundant classes: if two classes express the same information, the most descriptive name should be kept;
    Irrelevant classes: if a class has little or nothing to do with the problem, it should be eliminated;
    Vague classes: non-specific classes with ill-defined boundaries should be eliminated;
    Attributes: names that primarily describe individual objects should be restated as attributes
    Operations: if a name describes an operation that is applied to objects and not manipulated in its own right, then it is not a class
    Roles: the name of a class should reflect its intrinsic nature and not a role that it plays in an association
    Implementation constructs: constructs extraneous to the real world should be eliminated from the analysis model

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:

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:

8.5 Organize and simplify object classes using inheritance

Inheritance can be be added in two different ways:
  1. Bottom up: by generalizing common aspects of existing classes into a superclass.
    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.
  2. Top down: by refining existing classes into specialized subclasses. Top-down specializations are often apparent from the application domain. Look for noun phrases composed of various adjectives on the class name (e.g. fixed menu, pop-up menu, sliding-menu). Avoid excessive refinement. If proposed specializations are incompatible with an existing class, the existing class may be improperly formulated.
Multiple inheritance may be used to increase sharing, but only if necessary, because it increases both conceptual and implementation complexity.
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".

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.
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:

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
Henk Enting, h.d.enting@cs.utwente.nl