McGraw-Hill OnlineMcGraw-Hill Higher EducationLearning Center
Student Centre | Lecturer Centre | Info Centre | HOME

Glossary
Q 18.C supplement
Self-test Questions

Cover
Object-Oriented Systems Analysis and Design Using UML, 2/e
Simon Bennett, Systems Architect with GEHE UK
Steve McRobb, Senior Lecturer, De Montfort University
Ray Farmer, Associate Dean, Coventry University

Design Patterns

Self-test Questions



1

Which of the following statements best describes the relationship between patterns and frameworks?
A)A framework may involve many patterns.
B)A framework is more abstract than a pattern.
C)A pattern may incorporate one or more frameworks.
2

Several key principles underlie the use of patterns. Which of the following is not a key principle involved in the use of patterns?
A)Abstraction.
B)Separation of concerns.
C)Conformance testing.
3

A pattern is normally described in the format of a pattern template. Which of the following statements best describes the forces of a pattern?
A)The forces embody the constraints that must be addressed by the solution.
B)The forces describe why it is important to find a solution to the problem
C)The forces are the constraints that solution is unable to resolve.
4

Which of the following is not one of the categories defined for the GOF patterns?
A)Creational.
B)Static.
C)Behavioural.
5

Which of the following best describes an advantage of the Singleton pattern?
A)The pattern can be used to ensure that no more than a fixed number of instances of the Singleton class are created.
B)Using the pattern always makes a system easier to maintain.
C)When the pattern is used global data can be accessed more quickly.
6

Which of the following statements is true about the Composite pattern?
A)The pattern must be used in conjunction with the Singleton pattern.
B)The pattern makes it easier to add new leaf subclasses.
C)The pattern makes it easier to add new operations to each of the leaf subclasses.
7

Which of the following best describes when to use the State pattern?
A)The pattern may be used when a class has many states.
B)The pattern may be used when a class has many operations.
C)The pattern may be used when an object appears to change class at run-time.
8

Which of the following is not an advantage of the State pattern?
A)State behaviour is localized.
B)The Singleton pattern may be used with the State pattern.
C)State transitions are made explicit.
9

Which of the following is not an issue that should be considered before using a pattern?
A)If a simpler solution exists it should be used in preference to the pattern.
B)It is preferable to use patterns by themselves.
C)It is important that the context of the problem is consistent with the context of the pattern.
10

Which of the following statements is most appropriate when using a pattern during information systems development?
A)The pattern must be used without any changes to its overall structure.
B)The pattern should be implemented with names that are meaningful in the context of the application.
C)The names of the classes in the pattern should be given the general names from the pattern so that their roles are unambiguous.