Banner

 

Chapter 13

Answers to exercises

2.
What is encapsulation? Why is it desirable?

Encapsulation means that anything that can change an object is done within the object. This implies that an object cannot be directly altered by another object.

4.
Draw a generalization/specialization hierarchy to describe farm animals.

6.
Draw a generalization/specialization hierarchy to describe transport choices (e.g., bus, car, plane, boat). What attributes are common to all object classes? What are some unique attributes of a plane?

8.
How does OO reduce maintenance costs?

Maintenance costs are decreased by using OO concepts. Maintenance costs are lowered because logical and syntactical errors are decreased, missing or incorrect specifications occur less frequently, the addition of features is easy, and it accommodates well to business changes.

10.
Why do objects pass messages?

Objects pass messages to communicate with one another. These messages request an object to do something, the object reacts in accordance to a method that was developed to address the different messages needs.

12.
When is an ODBMS required?

An ODBMS is required to store details of persistent objects, objects that must exist longer than the duration of a programís execution.

13.
How do an ODBMS and an RDBMS differ in the way they handle recording relationships?

An ODBMS differs from a RDBMS in the way it handles recording relationships. An ODBMS uses pointers for quick access of data and joins are not necessary for an ODBMS. A RDBMS uses foreign keys and joins to access data and express relationships.

16.
A travel company sells two types of trips: ship cruises and bus tours. Customers fall into two categories: group and individual. Group customers belong to an affinity group (e.g., a bird watchers' club), which will book a block of tickets on a trip. Individual customers make personal bookings. Some individual customers, because of their frequent use of the travel company, are designated gold star travelers and receive additional benefits when traveling. Draw a class and object layer model.

18.
An agent can represent many bands, but a band has only one agent. A band consists of many musicians, but a musician belongs to only one band. Model this situation using association and aggregation relationships.

20.
An educational software developer has asked you to develop a database of orchestral musical instruments. An orchestra consists of four broad classes (strings, woodwinds, brass, and percussion). What data would you store for each musical instrument? How would the data describing a drum differ from those of a violin? Draw a class and object layer model. Consider one of the microcomputer databases with which you are familiar. How suitable would it be for this database?

 

This page is part of the promotional and support material for Data Management (fifth edition) by Richard T. Watson
For questions and comments please contact the author

Date revised: October 24, 2009