Index


Chapter 25

1. 

Why is a software design pattern considered to be a form of knowledge reuse?

image from book

2. 

What is the purpose of the Singleton pattern?

image from book

3. 

What is the purpose of the Factory pattern?

 - to create objects of a particular type

4. 

What is one potential benefit to using the Dynamic Factory pattern?

image from book

5. 

How can application behavior can be dynamically modified using the Dynamic Factory pattern?

image from book

6. 

What is the purpose of the Model-View-Controller (MVC) pattern?

 - separates the presentation from the application proper

7. 

What’s the purpose of the Model component of the MVC pattern?

 - embodies the application proper

8. 

What’s the purpose of the View component of the MVC pattern?

 - embodies the user interface

9. 

What’s the purpose of the Controller pattern of the MVC pattern?

 - coordinates message passing between the model and the view

10. 

Why is it desirable to deny knowledge of the View from the Model and vice versa?

 - so the model can be utilized regardless of what type of view is required.

11. 

What’s the purpose of the Command pattern?

image from book

Answers

1. 

- Many extremely bright, talented software professionals working hard over the years to produce robust, reliable, flexible software architectures, noticed that for similar design problems they created similar design solutions. These similar design solutions consisted of a set of one or more related classes and object interactions. The real intellectual leap came when these engineers realized they could extract the essence of each design solution into a more general solution specification. These general solution specifications could then be readily reused and applied as the architectural basis of specific design solutions for the design problems they addressed.

2. 

- The Singleton is used when your application needs only one instance, or a controlled number of instances, of a particular type.

3. 

- To create objects of a particular type

4. 

- Improvements can be made to the application by upgrading the class files without recompiling the entire application.

5. 

- Improvements can be made to the application by upgrading the class files without recompiling the entire application.

6. 

- separates the presentation from the application proper

7. 

- embodies the application proper

8. 

- embodies the user interface

9. 

- coordinates message passing between the model and the view

10. 

- So the model can be utilized regardless of what type of view is required.

11. 

- The Command pattern is used to 1) decouple the knowledge of a particular action from an object that needs the action carried out, and 2) to encapsulate the action in the form of an object.




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