This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Design Question?" Watch "Design Question?" New topic
Author

Design Question?

seagullz peizhi
Greenhorn

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
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

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.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
seagullz peizhi
Greenhorn

Joined: Jun 05, 2002
Posts: 13
thank you Mike,i will follow you ideas
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Design Question?