Tuesday, November 2, 2010



1

Open the project dome-v1. It contains the classes exactly as they were discussed in the text.

Create some CD objects and some video objects.

Create a database object.

Enter the CDs and videos into the database, and then list the database contents.




















2

Try the following.

Create a CD object.

Enter it into the database.

List the database.



You see that the CD has no associated comment.

Add a comment to the CD object on the object bench (the one you entered into th

e database).

When you now list the

database again, will the CD listed there have a comment attached?

Try it. Explain the behavior you observe.

3

Draw an inheritance hierarchy for the people in your place of study.


Done on a paper

4

Open the project dome-v2. This project contains a version of the DoME application rewritten to use inheritance, as described in the text.

*Note that the class diagram displays the inheritance relationship.

Open the source code of the Video class and remove the "extends Item" phrase. Close the editor.

What changes do you observe in the class diagram?

Add the "extends Item" phrase again.

5

Create a CD object.

Call some of its methods.

Can you call the inherited methods(for examplesetComment())?

What do you observe about the inherited methods?


Yes I can call the inherited methods.

??????????

6

Set a breakpoint in the first line of the CDclass's constructor.

Then create a CD object. When the debugger window pops up, use Step Into to step through the code.

Observe the instance fields and their initialization.

Describe your observations.






No comments:

Post a Comment