Thursday, 12 April 2007

ADAPTER PATTERN

ADAPTER PATTERN

According to my understanding and research done on the adapter pattern, adapter pattern alway come in two forms and that is object adapter and class adapter. To make it more simpler for me to understand and explain, i will explain each one, one by one.




An adapter pattern allows classes from different part of the design to get together because of incompatibility. The job of adapter is to bring then together anbd make them work regardless of the different code or design. e.g if you write a code in JAVA and in are using SQL server, both of them might not be compatible must with the use of adapter, this is very possible.

OBJECT ADAPTER PATTERN

firstly, object adapter pattern, Object adapters use a constitution method to get one interface to another. The adapter trys to get the interface that the client we like to see in the ddesign of the system, while the instance of the adaptee is hold.



CLASS ADAPTER PATTERN
Class adapters use alot of inheeitance from differnet part to achieve their goals, the class apater does not use the interface of the clients but its inherit the interface of the customer and also inherit the interface of the adaptee.



REFERENCE

http://exciton.cs.rice.edu/JavaResources/DesignPatterns/adapter.htm

1 comment:

Kwame Ako-Aboagye said...

I have read your idea concerning adaptor pattern and really think explanation towards the adaptor patterns would help and encourage people to use that idea for any future plans when dealing with adaptor patterns.