Database Reference
In-Depth Information
CLASS
YACHT_DESIGN
HOUSE_MODEL
ClassName
DesignName
ModelName
NumberHours
Description
Description
Length
Beam
NumberStateRooms
NumberHeads
Description
NumberBedrooms
SquareFootage
GarageSize
SECTION, YACHT,
and HOUSE are
weak, but not
ID-dependent,
entities.
SECTION
YACHT
HOUSE
ReferenceNumber
LicenseNumber
State
Street
City
State
Zip
ClassDays
Time
Professor
SectionNumber
HullNumber
DateManufactured
DateSold
SalesPrice
Figure 5-31
Three Archetype/
Instance Patterns Using
Non-ID-Dependent Entities
HouseNumber
CLASS before we can add a SECTION for that class. Additionally, when we delete a
CLASS, we must delete all of the SECTIONs for that CLASS as well. This is one reason
that some data modelers believe that weak, non-ID-dependent entities are important.
Skeptics say that although weak, non-ID-dependent entities may exist, they are
not necessary. They say that we can obtain the same result by calling SECTION strong
and making CLASS required. Because CLASS is required, the application will need to
insert a CLASS before a SECTION is created and delete dependent SECTIONs when
deleting a CLASS. So, according to that viewpoint, there is no practical difference be-
tween a weak, non-ID-dependent entity and a strong entity with a required relationship.
Others disagree. Their argument goes something like this: The requirement that a
SECTION must have a CLASS comes from a logical necessity. It has to be that way—it
comes from the nature of reality. The requirement that a strong entity must have a re-
lationship to another strong entity arises from a business rule. Initially, we say that an
ORDER must have a CUSTOMER (both strong entities), and then the application re-
quirements change and we say that we can have cash sales, meaning that an ORDER
no longer has to have a CUSTOMER. Business rules frequently change, but logical ne-
cessity never changes. We need to model weak, non-ID-dependent entities so that we
know the strength of the required parent rule.
And so it goes. You, with the assistance of your instructor, can make up your own
mind. Is there a difference between a weak, non-ID-dependent entity and a strong en-
tity with a required relationship? In Figure 5-31, should we call the entities SECTION,
YACHT, and HOUSE strong, as long as their relationships are required? We think not—
we think there is a difference. Others think differently, however.
Mixed Identifying and Nonidentifying Patterns
Some patterns involve both identifying and nonidentifying relationships. The classic example
is the line-item pattern, but there are other instances of mixed patterns as well. We begin with
line items.
The Line-Item Pattern
Figure 5-32 shows a typical sales order, or invoice. Such forms usually have data about the or-
der itself, such as the order number and order date, data about the customer, data about the
salesperson, and then data about the items on the order. A data model for a typical sales order
or invoice is shown in Figure 5-33.
 
 
Search WWH ::




Custom Search