Lucy Sommerman

Ranch Hand
+ Follow
since Nov 25, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Lucy Sommerman

Ah okay, I got it..thanks...well i think that if I have time maybe I could gain myself a few extra points by doing the proxy thing, as that is really *better* design, no? but what I have is okay...so now all i have to do is a bit more documentation and then I am there...phew long haul, but will see it thru having come this far...

Thanks v. much for your help.

Lucy
Just wanted to quickly check that my RMI design is okay...have finished but maybe what i have done is so shoddy they will fail me...SO..doing B&S..

I have a Data class that implements the DBAcess interface (no rmi in either)
I have a RemoteData class that implements RemoteDB.
RemoteDB is identical to DBAccess interface except that it extends java.rmi.Remote and its methods throw java.rmi.RemoteException.
RemoteData implements RemoteDB and extends java.rmi.UnicastRemoteObject.

The RemoteData class has an instance of Data as a variable - so when its methods are called it calls the equivalent method in the Data class - i.e. used the same code, just with RMI wrapper.

I *think* this is all basically OK. However, in my GUI, I have an instance of RemoteData r and Data d. At startup, the mode (i.e. standalone, client, server) is passed to the GUI, and if we are in client mode then we call methods on RemoteData r, else we call on Data d. Does that sound basically okay, or is really bad design? I have heard others speak of DataProxy, but have not quite comprehended what is meant by that...

Thanks

Lucy
sheesh i think i will write some more documentation...last question...do I need to study for the exam, or enough just to revise what I have done and go in there and write about? what people thinK?
hmm..so we can safely assume that my page and a half is woefully inadequate... o well we will just have to see how it goes...and the exam just asks you to justify the decisions you made, right, explain RMI, etc...
Ok, i have tested everything many times, etc...last question..how much explanation do i need in choices.txt. Have about a page and a half explaining what i have done and why...is that enough, or woefully short...pse advise, then I shall submit and pray. Also...how long between submission and when you have to sit your exam...? And how long is the exam?

Sorry for all the questions, I'll be done soon.
Thanks

L
by location do you mean port number? or something else?

Thanks

L
RE B&S
"The program must allow the user to specify the location of the database, and it must also accept an indication that a local database is to be used, in which case, the networking must be bypassed entirely."

I have three modes, server, client, alone...have assumed that only alone uses a local database...or can client mode use a local db as well? If so, kind of defeats purpose of having client/server, no?

Thanks

L
Hi - I'm finished - how do I submit the assignment?

Thanks

L
Hi - thanks for yr help. However, can I ask for some clarification.


CURRENT SITUATION:

interface DBAccess (extends java.rmi.Remote, but this needs to be changed, as not allowed to alter this interface)

class Data (implements DBAccess, extends java.rmi.server.UnicastRemoteObject)

//server
DBAcess dba = new DBAccess();
Data r = (Data)dba;
r.loadData();
//create and bind registry
LocateRegistry.createRegistry(port);
Registry registry = LocateRegistry.getRegistry(port);
registry.rebind("Data", r);

//client
Data d = (Data)Naming.lookup("Data");
System.out.println("Running as client");
Gui g = new Gui (d);
g.createAndShowGui(d);

The Gui constructor parameter is of type DBAccess.

FUTURE SITUATION:

I can remove all rmi from the DBAccess interface and Data class and create a new package suncertify.db.net to include the following:

RemoteDB - extends java.rmi.remote
RemoteData - implements RemoteDB, extends java.rmi.server.UnicastRemoteObject

But is that not (unnecessary) duplication of code?

I'm not quite sure about this proxy...

"the proxy is the thing your client application is calling methods on, with the proxy being responsible for forwarding those calls to the network enabled RemoteData instance you got back when opening the RMI connection."

I can have a DataProxy class that implements DB but not sure what should go in there...Or maybe I am confused about what should go in the RemoteData class..

Can you pse provide a little more info...

Thanks

L
Hi - I am doing Boggit and Scrapper - quick question..the instructions say that the Data class must implement the DBAccess interface. However, the DBAccess interface does not extend ..rmi. I can use an adapter pattern...but then the Data class is not implementing DBAccess.

Pse advise.

Thanks

L
Hi - I am compiling rmi code and am not getting a skeleton just a stub. Are skeletons outdated now - I am using JSE 1.5.6...

pse advise.

Thanks

L
yea it works if I supply a sourcepath - but I compile from that directory so I would have thought it would have looked there automatically, always has before with JDK - any clues why it would need the source path now? O well, I guess I can just set sourcepath as an evironment variable?
J2RE was installed but removed that, think that can alter classpath sometimes at runtime? dunno...clues?