It's not a secret anymore!
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Design Question? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Design Question?" Watch "Design Question?" New topic

Design Question?

seagullz peizhi

Joined: Jun 05, 2002
Posts: 13
i follow Mike and most people's design idea,but have some questins please give you hand
**DataInterface -define all the public methods in data
**Data -Implements DataInterface also have criteriaFind and lock/unlock methods.
**RemoteDataInterface -extends Remote and DI. It is the interface for rmi calls.
**DataAccessLocal -Implements DI,
**DataAccessRemote -Implements RemoteDataInterface
i have a DataFaceory class in client ,which return a database connection depending on the arguments.
in DataAccessLocal i use Adapter pattern as

i am not sure the DataAccessRemote for i want to the same pattern in DataAccessRemote. as follows

and in the server class i use

Am i right as for the DataAccessRemote ,thank you for your help?

i am a beginner ,thank you
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

Well in your DataAccessRemote, your constructor accepts a DataInterface, but you are passing it a Data reference in the server. Did you change your Data class to implement DataInterface? if so, you are ok with that code, otherwise you need to change the constructor of the DataAccessRemote to accept a Data class and not a DataInterface.

Then you are binding the remote class to the registry. I think you will find out later that you do not want to do this for client id reasons.
Try doing a search on ConnectionFactory in this forum, you will find some very interesting reading there.
Good Luck, and we are all here to help you, so don't be shy.

Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
seagullz peizhi

Joined: Jun 05, 2002
Posts: 13
thank you Mike,i will follow you ideas
I agree. Here's the link:
subject: Design Question?
jQuery in Action, 3rd edition