Consider the object model of Figure 5-32 in the book. Using association multiplicity only, can you modify the model such that a developer unfamiliar with the Gregorian calendar could deduce the number of days in each month? Identify additional classes if necessary.

What will be an ideal response?


The purpose of this exercise is to show the limitation of association multiplicities. There is no complete solution to

this problem. A partial solution indicating the number of days in each month is depicted in Figure 5-5. We created

four abstract classes for each of the possible month lengths, 11 classes for each of the nonvariable months and two

classes for the month of February. The part that cannot be resolved with association multiplicities is the definition of

a leap year and that the number of days in February depends on whether the year is leap or not. In practice, this

problem can solved by using informal or OCL constraints, described in more detail in Chapter 9, Object Design:

Specifying Interfaces.



Computer Science & Information Technology

You might also like to view...

Case-Based Critical Thinking QuestionsCase 2  In his database of thousands of records, Suresh wants to standardize the format of certain fields. However, he does not want to store the formatting characters (e.g., parentheses, dashes, and slash characters).  He decides to consult Sheila because she has extensive experience with input masks. Suresh wants all of the letters that appear in a license plate to appear as uppercase, but he knows that some of his users enter these letters as lowercase letters. According to Sheila, what input mask character is the solution to his problem?

A. L B. ! C. ? D. >

Computer Science & Information Technology

Explain what might happen if managerial guidance SysSP documents have not been written or provided to technical staff.

What will be an ideal response?

Computer Science & Information Technology

Which type of system enables you to play music and watch movies and television?

A. Home-theater PC B. Video workstation C. Graphics workstation D. Digital audio workstation

Computer Science & Information Technology

Critical Thinking Questions Case 8-2 ? An employee at PrattLast Associates created a form for the database and would like to make some changes using the FORM LAYOUT TOOLS ARRANGE tab. The employee needs to delete a row from a form. How should he accomplish this task? a. Click any control in the row to delete, click Select Column, press the ADJUST key to delete the row. b. Click any control in the row to delete, click Select Column, press the DELETE key to delete the row. c. Click any control in the row to delete, click Select Column, press the REMOVE key to delete the row. d. Click any control in the row to delete, click Select Column, press the ALTERNATE key to delete the row.

What will be an ideal response?

Computer Science & Information Technology