Solved

JCA - Adapter pattern

Posted on 2006-11-25
7
252 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jdbc error in jsp application 20 91
Chrome and Firefox Java 5 88
swing controls 2 37
java mysql insert application 14 68
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
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 third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
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…
Suggested Courses

734 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