3.8 Exercises


3.8 Exercises

  1. Explain and give examples of the difference between classes and objects. Why is the object considered a dynamic concept? Why is the class considered a static concept? Explain.

  2. Explain why the UML class and object diagrams are very similar. What do these diagrams actually describe about an object and about a class? Explain.

  3. Explain and give examples of object behavior. Is object interaction the same as object behavior? Explain and give examples. What UML diagram describes this? If an object-oriented application has only one object, is there any object interaction? Explain.

  4. What are the differences between encapsulation and information hiding? How are these two concepts related? Explain.

  5. From the principle of information hiding, why are the two views of an object at different levels of abstraction? Explain. How useful can this principle be in software development?

  6. Consider an automobile rental office. A customer can rent an automobile for a number of days and with a finite number of miles (or kilometers). Identify the type and number of objects involved. For every type of object, list the properties and operations. Draw the class and object diagrams for this problem. As a starting point, use class Automobile described in this chapter.

  7. For the automobile rental office, describe the object interactions necessary. Draw the corresponding collaboration diagrams.

  8. Consider a movie rental shop. Identify the various objects. How many objects of each type are there? List the properties and the necessary operations of the objects. Draw the corresponding UML diagrams for this problem.

  9. For the two problems described in Exercises 7 and 8, list the private and public characteristics (properties and operations) for every type of object. Why do you need to make this distinction? Explain.




Object-Oriented Programming(c) From Problem Solving to Java
Object-Oriented Programming (From Problem Solving to JAVA) (Charles River Media Programming)
ISBN: 1584502878
EAN: 2147483647
Year: 2005
Pages: 184

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net