Draw a class diagram representing the relationship between parents and children. Take into account that a person can have both a parent and a child. Annotate associations with roles and multiplicities.

What will be an ideal response?


Figure 2-7 depicts a canonical solution. This exercise is meant to emphasize the difference between a relationship, a
role, and a class. In the above sentence, parent and child are roles while person is the class under consideration. This
results in a class diagram with a single class and a single association with both ends to the class.
A common modeling mistake by novices is to draw two classes, one for the parent and one for the child.

Error:

Computer Science & Information Technology

You might also like to view...

Showthat the algorithm for concurrently accessing a B+tree in which operations that only search the tree use lock coupling and operations that modify the tree handle write latches in a two-phase fashion guarantees that all operations are carried out successfully.

What will be an ideal response?

Computer Science & Information Technology

A more eloquent approach in implementing mutator methods is to return a ________ value.

a. int b. char c. boolean d. double

Computer Science & Information Technology

When you first create a mask layer, Flash ____________________ both the mask and the masked layers.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Which of the following is a well-known Linux distribution?

A. Ubuntu B. Brownstone C. Trinidad D. Haswell

Computer Science & Information Technology