Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

JCA - Adapter pattern

Posted on 2006-11-25
7
Medium Priority
?
268 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 1860 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

719 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