4 ms·
What I could gather from the wikipedia entry on the "Adapter Pattern"[0] is that an Adapter is a wrapper class that conforms to a different interface than the c
by bglazer 12y ago
What I could gather from the wikipedia entry on the "Adapter Pattern"[0] is that an Adapter is a wrapper class that conforms to a different interface than the class that it is wrapping.
For example, class A implements foo(), but you want it to conform to interface B which requires that you implement bar(). So you make an "Adapter" which implements bar() by calling foo().
This is probably oversimplifying but conceptually it's like a USB to serial adapter. Provide the same functionality through a different interface.
An AdapterFactory might automatically create an Adapter between two classes?
As for an AbstractAdapterFactory, you might have a couple different AdapterFactories and you want some shared functionality between them. Same reasons you'd make any class abstract.
That's all speculation though, I've never actually coded with an "Adapter" before.
[0] http://en.wikipedia.org/wiki/Adapter_pattern http://en.wikipedia.org/wiki/Adapter_pattern