Page 333 -
P. 333

304           PART THREE  CONVENTIONAL METHODS FOR SOFTWARE ENGINEERING


         FIGURE 12.3                                Naming     Ties one data object to another,
         Tabular                                    attributes  in this case, owner
         representation
         of data objects                                             Descriptive  Referential
                                                           Identifier  attributes  attributes

                                              Make  Model   ID#    Body type  Color Owner
                                              Lexus  LS400  AB123. . .  Sedan  White  RSP
                                      Instance  Chevy Corvette X456. . .  Sports  Red  CCD
                                              BMW   750iL  XZ765. . .  Coupe  White  LJL
                                              Ford  Taurus  Q12A45. . . Sedan  Blue  BLF



                       Attributes. Attributes define the properties of a data object and take on one of three
                       different characteristics. They can be used to (1) name an instance of the data object,
                       (2) describe the instance, or (3) make reference to another instance in another table.
         Attributes name a data  In addition, one or more of the attributes must be defined as an identifier—that is, the
         object, describe its  identifier attribute becomes a "key" when we want to find an instance of the data
         characteristics, and in  object. In some cases, values for the identifier(s) are unique, although this is not a
         some cases, make
         reference to another  requirement. Referring to the data object car, a reasonable identifier might be the ID
         object.       number.
                          The set of attributes that is appropriate for a given data object is determined through
                       an understanding of the problem context. The attributes for car might serve well for
                       an application that would be used by a Department of Motor Vehicles, but these attri-
                       butes would be useless for an automobile company that needs manufacturing con-
                       trol software. In the latter case, the attributes for car might also include ID number,
                       body type and color, but many additional attributes (e.g., interior code, drive train
                       type, trim package designator, transmission type) would have to be added to make
                       car a meaningful object in the manufacturing control context.

                       Relationships. Data objects are connected to one another in different ways. Con-
                       sider two data objects, book and bookstore.  These objects can be represented using
         Relationships indicate  the simple notation illustrated in Figure 12.4a. A connection is established between
         the manner in which  book and bookstore because the two objects are related. But what are the rela-
         data objects are  tionships? To determine the answer, we must understand the role of books and book-
         “connected” to one
         another.      stores within the context of the software to be built. We can define a set of
                       object/relationship pairs that define the relevant relationships. For example,
                         •  A bookstore orders books.
                         •  A bookstore displays books.
                         •  A bookstore stocks books.
                         •  A bookstore sells books.
                         •  A bookstore returns books.
   328   329   330   331   332   333   334   335   336   337   338