Software Engineering-The Object Relationship Model


The CRC modeling approach establishes the first elements of class and object relationships. The first step in establishing relationships is to understand the responsibilities for each class. The CRC model index card contains a list of responsibilities. The next step is to define those collaborator classes that help in achieving each responsibility. This establishes the “connection” between classes.

A relationship exists between any two classes that are connected. Therefore, collaborators are always related in some way. The most common type of relationship is binary—a connection exists between two classes. When considered within the context of an OO system, a binary relationship has a specific direction that is defined based on which class plays the role of the client and which acts as a server.

Rumbaugh and his colleagues  suggest that relationships can be derived by examining the stative verbs or verb phrases in the statement of scope or use-cases for the system. Using a grammatical parse, the analyst isolates verbs that indicate physical location or placement (next to, part of, contained in), communications (transmits to, acquires from), ownership (incorporated by, is composed of), and satisfaction of a condition (manages, coordinates, controls). These provide an indication of a relationship.

The Unified Modeling Language notation for the object-relationship model makes use of a symbology that has been adapted from the entity-relationship modeling techniques . In essence, objects are connected to other objects using named relationships. The cardinality of the connection  is specified and an overall network of relationships is established.

The object relationship model (like the entity relationship model) can be derived in three steps:

1. Using the CRC index cards, a network of collaborator objects can be drawn. Figure  represents the class connections for SafeHome objects. First the objects are drawn, connected by unlabeled lines (not shown in the figure) that indicate some relationship exists between the connected objects.



2. Reviewing the CRC model index card, responsibilities and collaborators are evaluated and each unlabeled connected line is named. To avoid ambiguity, an arrow head indicates the “direction” of the relationship.

3. Once the named relationships have been established, each end is evaluated to determine cardinality . Four options exist: 0 to 1, 1 to 1, 0 to many, or 1 to many. For example, the SafeHome system contains a single control panel (the 1:1 cardinality notation indicates this). At least one sensor must be present for polling by the control panel. However, there may be many sensors present (the 1:m notation indicates this). One sensor can recognize from 0 to many sensor events (e.g., smoke is detected or a break-in has occurred).

The steps just noted continue until a complete object-relationship model has been produced.
Share this article :
 
Copyright © 2012. Best Online Tutorials | Source codes | Programming Languages - All Rights Reserved