Chapter 11


Chapter 10

1. 

What is a dependency relationship between two objects?

image from book

2. 

What is an association relationship between two objects?

image from book

3. 

What is an aggregation?

 - an aggregation is an association between two objects that results in a whole/part relationship.

4. 

List the two types of aggregation.

image from book

5. 

Explain the difference between the two types of aggregation.

image from book

6. 

How do you express simple aggregation using a UML class diagram?

image from book

7. 

How do you express composite aggregation using a UML class diagram?

image from book

8. 

Which type of aggregation denotes a uses or uses a relationship between two objects?

image from book

9. 

Which type of aggregation denotes a has or has a relationship between two objects?

image from book

10. 

What is the purpose of a UML sequence diagram?

 - the sequence diagram shows message sequencing between application objects.

11. 

Explain the utility of the typesafe enumeration pattern.

image from book

12. 

A class built from other class types is referred to as a/an ________________________.

image from book

13. 

In this type of aggregation part objects belong solely to the whole or containing class. Name the type of aggregation.

 - composite aggregation

14. 

In this type of aggregation part object lifetimes are not controlled by the whole or containing class. Name the type of aggregation.

image from book

15. 

In a UML class diagram the aggregation diamond is drawn closest to which class, the whole or the part?

image from book

Answers

1. 

- A dependency is a relationship between two classes in which a change made to one class will have an affect on the behavior of the class or classes that depend on it.

2. 

- An association is a relationship between two classes that denotes a connection between those classes. An association implies a peer-to-peer relationship between the classes that participate in the association.

3. 

- An aggregation is an association between two objects that results in a whole/part relationship.

4. 

- simple, composite

5. 

- In a simple aggregation the whole object does not control the lifetime of its part objects. In a composite aggregation, the whole object controls the lifetime of its part objects.

6. 

- By a line connecting the whole class its part class(s). A hollow diamond adorns the line closest to the whole class.

7. 

- By a line connection the whole class to its part class(s). A solid diamond adorns the line closest to the whole class.

8. 

- simple

9. 

- composite

10. 

- The sequence diagram shows message sequencing between application objects.

11. 

- The typesafe enum pattern is used in Java 1.4.2 coding practice in place of enumerated types. (Enumerated types were introduced to the Java language starting with Java 5.)

12. 

- Composite

13. 

- Composite aggregation

14. 

- Simple aggregation

15. 

- the whole class




Java For Artists(c) The Art, Philosophy, and Science of Object-Oriented Programming
Java For Artists: The Art, Philosophy, And Science Of Object-Oriented Programming
ISBN: 1932504052
EAN: 2147483647
Year: 2007
Pages: 452

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