Adapter Pattern:
the intent is converting the interface of a class into another interface the clients expect.
it includes two main kinds. First is the Object Adapter, and the second is Class Adapter.
Object Adapter pattern is using object composition.
It's very simply if the adatpee and adapter has unique counterpart property or method.
In my opionin, the adapter just straightforward pass through the field in the adaptee.
the Difference between Adapter pattern and Decorater pattern:
Decorater pattern is to add responsiblity in the existing class(or interface?).
Adapter pattern is converting the interface to another different interface expected by the client.
Facade Pattern:
creat a class which has a simple and clean functionary for the client, and this class implement is accomplished by a more complex subsystems(a lot of class).
The principle of Least Knowledege should be applied when FacadeClass invokes one method in the subsystem.
My question is:
1. if the fields in the adapter and the adaptee is incompatible, how to create an adapting interface for the client? As shown in <Head First>, throw unknown exception?
2. the Facade pattern is much more like to create a new class and the methods in this class is totally decided by the Client. However, what seems weird is that the new classjust invoke some functionary in other classes?