Table of Contents
- 1 What problems do design pattern address?
- 2 Which of the following is not a design pattern?
- 3 When would you not use design patterns?
- 4 Is design patterns book still relevant?
- 5 Which of the following describes the null object pattern correctly?
- 6 Which of the following design problems does the Adapter pattern solve?
What problems do design pattern address?
What is a design pattern? In simple sentence, a design pattern is a way to design our software/application. Each design pattern addresses a problem or set of problem and describe a solution for it. So these design patterns help us understand those problems and solve them effectively.
Which of the following is not a design pattern?
Explanation: Java patterns is not a valid classification of design patterns. The correct one is J2EE patterns.
What problems does the decorator pattern solve?
The decorator design pattern is one of the twenty-three well-known GoF design patterns; these describe how to solve recurring design problems and design flexible and reusable object-oriented software—that is, objects which are easier to implement, change, test, and reuse.
When would you not use design patterns?
If a problem has two solutions, one that fits in ten lines of code, and another one with hundreds of lines of code along with a pattern, please consider not using the pattern. Their presence isn’t a quality measurement.
Is design patterns book still relevant?
Yes. Most enterprise development software is built using these paradigms. A lot of building block code are written with design patterns and a good understanding of them allows you to use them properly.
Are there more than 23 design patterns?
There are 23 official patterns from the book Design Patterns – Elements of Reusable Object-Oriented Software, which is considered one of the most influential books on object-oriented theory and software development.
Which of the following describes the null object pattern correctly?
Q 1 – Which of the following describes the Null Object pattern correctly? A – In this pattern, a class behavior changes based on its state.
Which of the following design problems does the Adapter pattern solve?
The adapter design pattern solves problems like: How can a class be reused that does not have an interface that a client requires? How can classes that have incompatible interfaces work together? How can an alternative interface be provided for a class?
Which design pattern does not alter the interface but adds responsibility?
Decorator
Decorator – Doesn’t alter the interface, but adds responsibility.