Uploaded by Muhammad Mazhar

Design Pattrens Paper Pattren

advertisement
MCQS
Q 1 - Which of the following is true about design patterns?
A - Design patterns represent the best practices used by experienced object-oriented
software developers.
B - Design patterns are solutions to general problems that software developers faced
during software development.
C - Design patterns are obtained by trial and error by numerous software developers
over quite a substantial period of time.
D - All of the above.
Q 2 - Which of the following describes the Builder 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 is used when creation of object directly is costly.
D - This pattern is used when we need to decouple an abstraction from its
implementation so that the two can vary independently.
Q 3 - Which of the following describes the Facade pattern correctly?
A - This pattern allows a user to add new functionality to an existing object without
altering its structure.
B - This pattern is used where we need to treat a group of objects in similar way as a
single object.
C - This pattern hides the complexities of the system and provides an interface to the
client using which the client can access the system.
D - This pattern is primarily used to reduce the number of objects created and to
decrease memory footprint and increase performance.
Q 4 - Which of the following pattern creates a chain of receiver objects for a
request?
A - Proxy Pattern
B - Chain of Responsibility Pattern
C - Command Pattern
D - Interpreter Pattern
Q 5 - Which of the following pattern is used to get a way to access the elements
of a collection object in sequential manner without any need to know its
underlying representation?
A - Iterator Pattern
B - Mediator Pattern
C - Memento Pattern
D - Observer Pattern
Q 6 - Which of the following describes the Visitor pattern correctly?
A - In this pattern, a visitor class is used which changes the executing algorithm of an
element class.
B - This pattern is used to separate application's concerns.
C - This pattern is used to decouple presentation tier and business tier.
D - This pattern is used in EJB persistence mechanism.
Q 7 - Which of the following pattern is used to to decouple presentation tier and
business tier?
A - Visitor Pattern
B - MVC Pattern
C - Business Delegate Pattern
D - Composite Entity Pattern
Q 8 - Which of the following pattern is used when we want to do some preprocessing / post-processing with request or response of the application?
A - DAO Pattern
B - Front Controller Pattern
C - Intercepting Pattern
D - Service Locator Pattern
Q 9 - Which type of design patterns are specifically concerned with the
presentation tier?
A - Creational Design Patterns
B - Structural Design Patterns
C - Behavioral Design Pattern
D - J2EE Design Patterns
Q 10 - Which of the following is the correct list of entities of DAO pattern?
A - Data Access Object Interface, Data Access Object concrete class, Model Object or
Value Object
B - Data Access Object Interface, Model Object or Value Object
C - Data Access Object Interface, Data Access Object concrete class
D - Data Access Object concrete class, Model Object or Value Object
Answer the following Questions (3 * 10 =30)
a.
b.
c.
d.
e.
f.
g.
h.
i.
What is association ? differentiate between aggregation and composition .
What is Dependency Injection . Write and Example ?
How to use a design pattern? Write the guidelines.
What are the two variations of the adapter pattern?
What are the Consequences of Chain of Responsibility Pattern.
How many objects is the Singleton responsible for creating?
What is the basic problem being solved by the Bridge pattern?
What is Singleton pattern write the implementation?
Can we create a clone of a singleton object? If yes then How to prevent cloning of a
singleton object?
Long Questions
(a) Discuss about SOLID Design Principals..
( b) Draw Class Diagram With Implementation of factory design Pattern. [5+5]
2. (a) Explain the features of structural patterns in detail.
(b) Draw Class Diagram With Implementation of Adapter design Pattern. [5+5]
Download