July 2001
Beginner to intermediate
368 pages
6h 52m
English
Often, I will be in a situation similar to the one above, but the object being adapted does not do all the things I need.
In this case, I can still use the Adapter pattern, but it is not such a perfect fit. In this case,
Those functions that are implemented in the existing class can be adapted.
Those functions that are not present can be implemented in the wrapping object.
This does not give me quite the same benefit, but at least I do not have to implement all of the required functionality.
The Adapter pattern frees me from worrying about the interfaces of existing classes when I am doing a design. If I have a class that does what I need, at least conceptually, then I know that I can always use the Adapter pattern ...