GofPattern
SiteMap
Design Patterns Course
Behavioral Patterns
Creational Patterns
Structural Patterns
Design Patterns
«Prev
Next»
Design Patterns
Defining Patterns
Design Challenges
Pattern Concept
Design Pattern Components
Big-O Notation
Design Pattern Benefits
Three Types Design Patterns
Design Pattern Scope
Traffic Signals Project
Patterns Conclusion
Singleton Patterns
Design Pattern Elements
Intent Motivation
Pattern Applicability
Singleton Pattern Structure
Singleton Pattern-Quiz
Participants Collaborations
Consequences Effects
Class Implementation
Real World Examples
Substitute Patterns
Extension Variation Pattern
Course Project
Perfect Singleton
Pattern Conclusion
Creational Patterns
Creational Design Pattern
Creational Pattern Uses
Common Creational Patterns
Factory Pattern
Factory Method-Exercise
Factory Method Structure
Factory Method Consequences
Structural Patterns
Structural Pattern Example
StructuralPatterns Help Programmers
Patterns Help Programmers
Common Structural Patterns
Flyweight Pattern Motivation
Flyweight Suitability
FlyweightPattern Structure
FlyweightConsequences
Class Vehicles Intersection
Structural Patterns Conclusion
Behavioral Patterns
Define Behavioral Patterns
BehavioralPatterns Help Programmers
Common Behavioral Patterns
Observer Pattern Motivation
ObserverStructure TimeObserver Interface
TimeClass AsObserved Object
Observer Pattern Tradeoffs
Problems Require Mediator
Mediator Pattern Applicability
Mediator Pattern Structure
Benefits Pitfalls MediatorPattern
MediatorClass Course Project
Behavioral DesignPatterns Conclusion
Designing Software
How to Choose Pattern
How To Apply Pattern
Lessons Learned
Combine Design Patterns
Design Pattern Limitations
Traffic flow System
Course Conclusion
Singleton Pattern - Quiz
Each question is worth one point. Select the best answer for each question.
1.
The general purpose of the Singleton pattern is to:
Please select the best answer.
A.
Ensure that no more than one instance of a class exists.
B.
Ensure that only one instance of a class exists at the same time.
C.
Separate objects in a single class from objects in another class.
D.
Control creation of objects in a single class or another class.
2.
The participants in a design pattern are:
Please select the best answer.
A.
The methods used in the pattern
B.
The other patterns that participate with the pattern
C.
The classes and objects used in the pattern
D.
The fields used in the pattern
3.
The consequences of a design pattern are:
Please select the best answer.
A.
The pitfalls of using the particular pattern
B.
The results of choosing a pattern
C.
The time a program using the pattern takes to run
D.
The time it takes to design a program using the pattern
4.
Which of the following is specifically in the realm of applicability of the Singleton?
Please select the best answer.
A.
The class has only a single member method.
B.
The class has only a single field.
C.
The class should have exactly one instance.
D.
The class cannot be subclassed.
Submit
Quiz Explanation