Solved

JCA - Adapter pattern

Posted on 2006-11-25
7
259 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

615 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