Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

release the critics, here comes a design

 
Bryan Clauser
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a rough and dirty FBN services working, so now its time to start fine tuning things. Here is what I have:

package suncertify.db
IData- contains public methods of Data (interface)
IRData - extends IData, Remote (interface)
Data- implements IData (Data Class Sun provided but modified)
DataServer - extends UnicastRemoteObject implements IRData
LockManager- used to keep track of locks.

package suncertify.client
FBNGui- GUI components
DataClient- business logic, based on selection entered by user constructs IData, or IRData object reference
FBNTableModel- extends AbstractTableModel
CriteriaParser- used to parse the criteraString used in search
FBNMsgBundle- extends ListResourceBundle, allows for ease of label, col header changing.


Uncertainty 1.)
In DataServer an instance of Data (dataOR) is created in its constructor, and for DataServer's public methods in the
DataServer class, it calls dataOR.methodName().
example: public FieldInfo [] getFieldInfo() {return dataOR.getFieldInfo();}

This works fine, and seems fine to me, but that doesn't mean that I am not missing something.

Uncertainty 2.)
On the client side, my DataClient must try/catch on RemoteException. which is not needed for a local instance. But even though it is not needed for a local instance, does that merit the need that there should be both a local and remote DataClient that reside on the client side, since they will both make the same calls, only different try / catch blocks?

any comments?
Thanks
 
Laudney Ren
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) I think it's right.
2) On the client side, don't create two DataClient. Use the Proxy design pattern, which handles all the difference in local and network modes.
-- Laudney
 
Bryan Clauser
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Laudney,
Thanks for the responce.
I am pretty sure that I am using the proxy design pattern, in the DataClients constructor there is
if(isLocal)
IData = new IData()
else
IData = Naming.lookup(...)// getting an IRData

since IRData extends IData there is no problem returning either the local or remote interface to the use as its Data object refrence. Is that what you are talking about?
 
Forrest Xu
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the method in IData throw RemoteException, DatabaseException?
 
Bryan Clauser
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IData throws both DatabaseExceptions and RemoteExceptions
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic