SOFTWARE DESIGN
DESIGN PATTERNS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Adapter
|
|
Bridge
|
|
Either A or B
|
|
None of the above
|
Detailed explanation-1: -The Adapter pattern allows otherwise incompatible classes to work together by converting the interface of one class into an interface expected by the clients. Socket wrenches provide an example of the Adapter. A socket attaches to a ratchet, provided that the size of the drive is the same.
Detailed explanation-2: -The adapter pattern allows classes that have incompatible interfaces to work together. It does this by converting the interface of an existing class (or software) into one that a client (or service) expects.
Detailed explanation-3: -An Adapter Pattern says that just “converts the interface of a class into another interface that a client wants". In other words, to provide the interface according to client requirement while using the services of a class with a different interface. The Adapter Pattern is also known as Wrapper.