SOFTWARE DESIGN
DESIGN PATTERNS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
The implementation of the Adapter Pattern decreases the complexity of the code because you need not introduce new interfaces.
|
True
|
|
False
|
|
Either A or B
|
|
None of the above
|
Explanation:
Detailed explanation-1: -The main difference: Class Adapter uses inheritance and can only wrap a class. It cannot wrap an interface since by definition it must derive from some base class. Object Adapter uses composition and can wrap classes or interfaces, or both.
Detailed explanation-2: -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?
There is 1 question to complete.