Podcast
Questions and Answers
What is the purpose of the Adapter Pattern?
What is the purpose of the Adapter Pattern?
- To change the internal structure of objects
- To simplify the implementation of new interfaces
- To create new objects from existing ones
- To make the interfaces of objects appear as something they are not (correct)
When would you use the Adapter Pattern?
When would you use the Adapter Pattern?
- When the existing software needs to use a new class library with different interfaces (correct)
- When the existing software needs to completely replace the old class library
- When the new class library needs to be integrated as it is
- When the existing software needs to be rewritten from scratch
How does the client interact with the adapter?
How does the client interact with the adapter?
- By calling a method on it using the adaptee interface
- By creating a new instance of the adapter
- By calling a method on it using the target interface (correct)
- By directly accessing its internal methods
What does the adapter do with the client's request?
What does the adapter do with the client's request?
What does the client know about the adapter's role?
What does the client know about the adapter's role?
What is the main purpose of the Adapter Pattern?
What is the main purpose of the Adapter Pattern?
In the context of the Adapter Pattern, what does the client know about the adapter's role?
In the context of the Adapter Pattern, what does the client know about the adapter's role?
When would you use the Adapter Pattern?
When would you use the Adapter Pattern?
What does the adapter do with the client's request in the Adapter Pattern?
What does the adapter do with the client's request in the Adapter Pattern?
In the context of the Adapter Pattern, what happens when the client makes a request to the adapter?
In the context of the Adapter Pattern, what happens when the client makes a request to the adapter?