Creational Design Patterns
- Design Patterns - Factory Pattern
- Abstract Factory Pattern
- Design Patterns - Singleton Pattern
- Design Patterns - Builder Pattern
- Design Patterns - Prototype Pattern
Structural Design Patterns
- Design Patterns - Adapter Pattern
- Design Patterns - Bridge Pattern
- Design Patterns - Filter Pattern
- Design Patterns - Composite Pattern
- Design Patterns - Decorator Pattern
- Design Patterns - Facade Pattern
- Design Patterns - Flyweight Pattern
- Design Patterns - Proxy Pattern
- Chain of Responsibility Pattern
Behavioral Design Patterns
- Design Patterns - Command Pattern
- Design Patterns - Interpreter Pattern
- Design Patterns - Iterator Pattern
- Design Patterns - Mediator Pattern
- Design Patterns - Memento Pattern
- Design Patterns - Observer Pattern
- Design Patterns - State Pattern
- Design Patterns - Strategy Pattern
- Design Patterns - Template Pattern
- Design Patterns - Visitor Pattern
J2EE Design Patterns
- Design Patterns - Null Object Pattern
- Design Patterns - MVC Pattern
- Business Delegate Pattern
- Composite Entity Pattern
- Data Access Object Pattern
- Front Controller Pattern
- Intercepting Filter Pattern
- Service Locator Pattern
- Transfer Object Pattern
Design Patterns Useful Resources
Design Patterns Online Quiz
Following quiz provides Multiple Choice Questions (MCQs) related to Design Patterns Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.
Answer : A
Explanation
true. It is possible to get a clone of singleton object. Throw exception within the body of clone() method to prevent cloning.
Q 2 - Which of the following describes the Prototype pattern correctly?
A - This pattern builds a complex object using simple objects and using a step by step approach.
B - This pattern refers to creating duplicate object while keeping performance in mind.
C - This pattern works as a bridge between two incompatible interfaces.
Answer : B
Explanation
Prototype pattern refers to creating duplicate object while keeping performance in mind.
Q 3 - Which of the following pattern is used when we need to decouple an abstraction from its implementation so that the two can vary independently?
Answer : A
Explanation
Bridge pattern is used when we need to decouple an abstraction from its implementation so that the two can vary independently.
Q 4 - Which of the following pattern allows a user to add new functionality to an existing object without altering its structure?
Answer : D
Explanation
Decorator Pattern allows a user to add new functionality to an existing object without altering its structure.
Q 5 - Which of the following pattern is used to restore state of an object to a previous state?
Answer : C
Explanation
Memento pattern is used to restore state of an object to a previous state.
Q 6 - In which of the following pattern, an abstract class exposes defined way(s)/template(s) to execute its methods?
Answer : D
Explanation
In Template pattern, an abstract class exposes defined way(s)/template(s) to execute its methods.
Q 7 - Which of the following pattern is used in EJB persistence mechanism?
Answer : D
Explanation
Composite Entity pattern is used in EJB persistence mechanism.
Q 8 - Which of the following pattern is used when we want to do some pre-processing / post-processing with request or response of the application?
Answer : C
Explanation
Intercepting Pattern is used when we want to do some pre-processing / post-processing with request or response of the application.
Q 9 - Which type of design patterns concern class and object composition?
A - Creational Design Patterns
Answer : B
Explanation
Structural Design Patterns concern class and object composition. Concept of inheritance is used to compose interfaces and define ways to compose objects to obtain new functionalities.
Q 10 - Which of the following is the correct list of entities of Service Locator pattern?
A - Service, Context, Cache, Client
B - Service, Context, Service Locator, Cache, Client
Answer : B
Explanation
Service, Context, Service Locator, Cache, Client are the entities of Service Locator pattern.