Database Reference
In-Depth Information
• Choose an attribute whose values do not have built-in meanings. For example,
if part of the key for an object PRODUCT represents the warehouse code, the
key value will have to change if the product is no longer stored in the original
warehouse.
RELATIONSHIPS BETWEEN OBJECTS
Consider an order entry process. This is a typical process in most organizations.
Examine the information requirements. Apart from others, three business objects
feature prominently in the information requirements. The information requirements
are about CUSTOMER, ORDER, and PRODUCT. Each object has its own set of
attributes. If your data model represents just the three objects and their attributes,
then the model will not be a true representation of the information requirements.
Of course, in the real-world situation, you have these three objects. But that is not
the whole story. These three objects do not just remain in seclusion from one
another. The business process of order entry takes place on the basis of associa-
tions between the three objects. Accordingly, the data model must reflect these
associations.
Customers place orders; orders contains products. At a basic level, the object
CUSTOMER and the object ORDER are associated with each other. Similarly, the
object ORDER and the object PRODUCT are linked to each other. As you know,
such links and associations are represented as relationships in data model diagrams.
Role of Relationships
Let us inspect the associations among the three objects CUSTOMER, ORDER,
and PRODUCT. Figure 6-6 shows a data model diagram with these objects.
First, observe the relationship between CUSTOMER and ORDER. The rela-
tionship symbol indicates that the relationship exists because in the real-world sit-
uation a customer places an order. The action of placing an order forms the basis
for the relationship. A relationship name is an action word—usually a single verb.
Relationships indicate interaction between objects. They represent associations
between objects and the types of action that govern the associations.
Next, review the relationship between ORDER and PRODUCT. Here the action
is not as apparent; nevertheless, it is the action of an order containing products. The
association of ORDER with PRODUCT rests on the fact that orders are for
products, that is, orders contain products. The verb or action word in this case is
contains .
Look at the relationship symbol between CUSTOMER and ORDER. Does the
symbol indicate the linkage between the two boxes representing the two objects or
individual object instances within each of the two boxes? Figure 6-7 illustrates this
important distinction.
The relationship indicated between two object boxes is actually the association
between specific instances of one object and particular occurrences of another
object. Take a little time to grasp the significance of the meaning and role of rela-
tionships symbolized in data model diagrams. The connection shown between two
Search WWH ::




Custom Search