I will try to explain this in simple words, without much formality.
Imagine that you have some domain classes and user interface that you want to interact with. The facade can be used to provide functions that can be called from the user interface layer so that the user interface layer is not aware of any domain classes other than the facade. This means that instead of calling functions in domain classes, you call one function from the facade, which will be responsible for calling the necessary functions from other classes.
An adapter, on the other hand, can be used to integrate other external components that may have the same functionality, but their functions are not called exactly the same. Say that you have a Car class in your domain and you are working with an external car supplier who also has a Car class. In this class, you have the car.getDoors() function, but the external provider has the equivalent of car.getNumDoors() . You do not want to change the way this function is called, so you can use the adapter class to transfer the Car outer class so that the adapter getDoors() call is getDoors() to the outer class getDoors() call.
Pin Jun 03 '10 at 7:38 2010-06-03 07:38
source share