Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Design Question?

 
seagullz peizhi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
seagullz peizhi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you Mike,i will follow you ideas
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic