So I have to read and write a file on a remote host in remote mode.
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Originally posted by Michael Morris:
Hi Cathy,
You don't have to read or write to a file in either mode, that's Data's job. Once Data is initialized, you should just make calls on an interface and Data will take care of persistence (reading and writing to the backing file).
Michael Morris
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Originally posted by Michael Morris:
Hi Cathy,
That's the file that Data opens in it's constructor:
How can we tell the constructor which file to open?
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Even crazy and silly looking problems are sometimes real.
Originally posted by parthiban subramaniam:
Hi
well we will assume that you start your server like this
"java FlightServer [filename]"
now you have the file name .. this is the file the administrator of fbn wants to use for this service .. you can pass this file to the Data class constructor ..
if he has passed none .. like you said use the default file
But how the data object (constructed based on the filename in server) is passed to the GUI in remote mode?
The client does not care which data to use in remote mode, but it is the client that starts the GUI. I think the GUI needs to know which data to use to handle the events.
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Originally posted by Michael Morris:
That's where your network approach comes in.
If you are using RMI then you will need to create an interface that extends Remote and exposes all the public methods of Data. You will then need to provide a class the implements that interface and extends UnicastRemoteObject or Activatable. It is thru that class's remote stub that you will access the Data object on the server.
Is this the only place network comes in?
What is the relationship between this class which implements the interface and the provided Data.java class?
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |