Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • 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
Pie
Posts: 12014
220
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic