Both the facade and adaptor patterns are structural patterns.
Facade Pattern: In layman's terms the facade pattern could be thought of as the front end of a building. The facade pattern provides a single interface for various calling clients. It organizes the code in a better more readable fashion, hides the inner working of the system and reduces the network traffic.
Adaptor Pattern: The adaptor pattern could be thought of as a power adaptor used in UK for a device that is meant to work in USA voltage. In the adaptor pattern the calling client uses the adaptor as a single interface to perform the same operation. The adaptor in turn decides which operation should be called based on the environment.
The conclusion is that the facade pattern provides a single interface for multiple operations and the adaptor pattern provides a single interface for the same operation.
No comments:
Post a Comment