• Post Reply Bookmark Topic Watch Topic
  • New Topic

NX:Is my design OK?

 
HaoZhe Xu
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My project is URLyBird 1.3.1 and I am using RMI
on the server side, the service returns a remote instance of RemoteDBConnection, which contains a method getConnection, return an instance of RemoteDBAccessorImpl which has a Data object, and several business method such like search,book,read..., notice, RemoteDBAccessorImpl implements RemoteDBAccessorItf which extends Remote.
On the client side, there is a DBAccessor interface, and two classes ( DBLocalAccessor,DBRemoteAccessor) implement it, the client GUI has a DBAccessor referrence, which points to either DBLocalAccessor or DBRemoteAccessor, DBLocalAccessor uses a Data object, DBRemoteAccessor connects to a remote server and uses getConnection method to get a RemoteDBAccessorImpl instance.
It works in both mode (networked and non-networked) when I tested it, but is the design OK?
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Posts: 12056
232
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi HaoZhe,
That looks reasonable.
Does each instance of RemoteDBAccessorImpl have it's own instance of Data, or is there one instance of Data which is shared by all instances of RemoteDBAccessorImpl?
Regards, Andrew
 
HaoZhe Xu
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first case, each of them has own instance of Data
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!