1. | Why is a software design pattern considered to be a form of knowledge reuse? |
|
2. | What is the purpose of the Singleton pattern? |
|
3. | What is the purpose of the Factory pattern? |
|
4. | What is one potential benefit to using the Dynamic Factory pattern? |
|
5. | How can application behavior can be dynamically modified using the Dynamic Factory pattern? |
|
6. | What is the purpose of the Model-View-Controller (MVC) pattern? |
|
7. | What’s the purpose of the Model component of the MVC pattern? |
|
8. | What’s the purpose of the View component of the MVC pattern? |
|
9. | What’s the purpose of the Controller pattern of the MVC pattern? |
|
10. | Why is it desirable to deny knowledge of the View from the Model and vice versa? |
|
11. | What’s the purpose of the Command pattern? |
|
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. |