Adapter and Facade design pattern:
As per the WikiPedia "An Adapter is used when the wrapper must respect a specific interface and must support a polymorphic behavior. On the other hand, a facade is used when one wants an easier or simpler interface to work with."
Let's move ahead from the WikiPedia and get the sense in more simple terms.
The Adapter pattern just links two incompatible interfaces whereas Facade simplifies the implementations. If we put the analogy in our day-to-day life then:
Adapter = Making a square peg fit into a round hole.
Facade = A single Control Panel to run all the internal components.
Let's have a very simple and well-articulated example to understand the difference.
Imagine you've got some domain classes and from the UI you want to interact with them. A facade can be used to provide functions that can be called from the UI layer so that the UI layer doesn't know about any domain classes other than the facade. That means that instead of calling the functions in the domain classes you call a single function from the facade then that will be responsible of calling the necessary functions from the other classes.
An adapter, on the other hand, can be used to integrate other external components that might have the same functionality you need but their functions are not called quite the same way. Say you've got a Car class in your domain and you work with an external car provider that has a Car class defined as well. In this class, you've got the function car.getDoors() but the external provider has the equivalentcar.getNumDoors(). You don't want to change the way you call this function, so you can use an adapter class to wrap the external Car class so that a call to getDoors() of the adapter is delegated togetNumDoors() of the external class.
Again I would like to quote a diagram from the WikiPedia (followed by an example) to provide a feel for how Facade simplifies things.
This is an abstract example of how a client interacts with a facade (the "computer") to a complex system (internal computer parts, like CPU and Hard Drive and so on).
class Pattern_Facade
{
public static void Main(String[] args)
{
ComputerFacade computer = new ComputerFacade();
computer.start();
}
}
/* Complex parts */
class CPU
{
public void Freeze() { }
public void Jump(long position) { }
public void Execute() { }
}
class Memory
{
public void Load(long position, byte[] data) { }
}
class HardDrive
{
public byte[] Read(long lba, int size) { return new Byte[5]; }
}
/* Facade */
class ComputerFacade
{
private CPU processor;
private Memory ram;
private HardDrive hd;
private const long BOOT_ADDRESS = 00000;
private const long BOOT_SECTOR = 00000;
private const int SECTOR_SIZE = 0;
public ComputerFacade()
{
this.processor = new CPU();
this.ram = new Memory();
this.hd = new HardDrive();
}
public void start()
{
processor.Freeze();
ram.Load(BOOT_ADDRESS, hd.Read(BOOT_SECTOR, SECTOR_SIZE));
processor.Jump(BOOT_ADDRESS);
processor.Execute();
}
}
On the other hand, an Adaptor pattern is used when you want two different classes with incompatible interfaces to work together (Interfaces may be incompatible but the inner functionality should suit the needs). It allows incompatible classes to work together by converting the interface of one class into an interface expected by the clients.
The object adapter pattern is expressed in UML. The adaptor hides the adaptee's interface from the client.
The class adapter pattern is expressed in UML.

Prakash TripathiPosted Mar 6, 2016, 11:24 PM
Thnx Kumaresh.
Kumaresh RajalingamPosted Mar 6, 2016, 8:28 PM
good one
Kumaresh RajalingamPosted Mar 6, 2016, 8:28 PM
Nice explanation
Prakash TripathiPosted Feb 24, 2014, 9:01 PM
Adapter pattern also called as Wrapper or Decorator pattern.
Prakash TripathiPosted Feb 24, 2014, 9:00 PM
The adapter also used for transforming data into appropriate forms. For instance, if multiple Boolean values are stored as a single integer (i.e. flags) but the client requires individual Boolean values, the adapter would be responsible for extracting the appropriate values from the integer value. Another example is transforming the format of dates (e.g. YYYYMMDD to MM/DD/YYYY or DD/MM/YYYY)