Adapter design pattern

8 March 2008

A Adapter design pattern is Structural design pattern. It is also called as wrapper pattern or just a wrapper. Some classes could not work together because of incompatible interfaces. An adapter allows classes to work together by wrapping its own interface around that of an already existing class. The adapter also handles the logic necessary to transform data into an appropriate form.

The adapter design pattern is useful in circumstances where an already existing class provides some or all of the services you require but does not use the interface you require. The adapter design pattern adapts one interface for a class into one that a client expects.

The adapter patterns are of two types

Object Adapter pattern: In this type of adapter pattern, the adapter contains an OBJECT of the class it wraps. In such a situation, the adapter makes calls to the instance of the wrapped object.

Class Adapter pattern: It requires multiple multiple inheritance. As Java that does not support multiple inheritance, the Class Adapter pattern cannot be used in Java.

del.icio.us:Adapter design pattern  digg:Adapter design pattern  spurl:Adapter design pattern  wists:Adapter design pattern  simpy:Adapter design pattern  newsvine:Adapter design pattern  blinklist:Adapter design pattern  furl:Adapter design pattern  reddit:Adapter design pattern  fark:Adapter design pattern  blogmarks:Adapter design pattern  Y!:Adapter design pattern  smarking:Adapter design pattern  magnolia:Adapter design pattern  segnalo:Adapter design pattern  gifttagging:Adapter design pattern

Top Of Page | Trackback

If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.

It will look like this: Adapter design pattern

Leave a Reply