Solved

JCA - Adapter pattern

Posted on 2006-11-25
7
249 Views
Last Modified: 2008-02-26
Java connector Architecture follows Adapter pattern.

Any explanation on how this occurs with sample code would be helpful

simple explanation in laymans terms plzz!

thanks
J
0
Comment
Question by:jaggernat
  • 4
  • 3
7 Comments
 
LVL 23

Accepted Solution

by:
Ajay-Singh earned 465 total points
ID: 18013587
These are 2 key features adapter provides:
    1. Allows two or more previously incompatible objects to interact.
    2. Allows reusability of existing functionality.


JCA allows you to interact with the database, other resources seamlessly. The JCA interface is defined but the actual source may not follow that. So in order to make it work, we the source defines an adapter that interacts with the source.
0
 
LVL 10

Author Comment

by:jaggernat
ID: 18014490
I get the thoery. simple example code would help.

thanks
0
 
LVL 23

Expert Comment

by:Ajay-Singh
ID: 18014621
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 10

Author Comment

by:jaggernat
ID: 18014651
we have a adaptor class, a client and an adaptee.
the client is trying to call an adaptee which is modified by the adaptor. right?
not exactly sure what the role of client and the adaptee is.

0
 
LVL 23

Expert Comment

by:Ajay-Singh
ID: 18014873
> the client is trying to call an adaptee which is modified by the adaptor. right?
Yes

> not exactly sure what the role of client and the adaptee is.
client has an interface and adapter doesn't follow that interface. In order to interact with the client, adapter follows the client interface and modify the adpatee (calls its methods) when client wants to do something.
0
 
LVL 10

Author Comment

by:jaggernat
ID: 18014926
In Adapter pattern , an adapter wraps a class(target class) in such a way that the client class can call the adaptor to use the target class.
Client --> Adapter/ wrapper class --> Adaptee ( target).
So the client doesnt calls the target object(adaptee) which is an direclty, but invokes the adaptee through the Adapter.


above is my description of adapter pattern. Is it right?
0
 
LVL 23

Expert Comment

by:Ajay-Singh
ID: 18017108
yes
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This video teaches viewers about errors in exception handling.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question