Hi Bill,
I'm struggling with the same questions right now (Contractor assignment). I'm wrapping up my implementation and I've left these configuration questions for last. Here's what I've nailed down so far:
Server must have a way to configure RMI port.
Server must have a way to configure DB Location.
Client must have a way to specify a host URL.
Standalone mode is a bit fat wrench in the whole thing.
Just to give you a starting point here (Assuming you know a few Design Patterns) --
In my design, a DBServer is defined that can provide a Connection interface in two fashions - it can return one from a method, or it can bind one in the rmiregistry. This Connection interface is a Facade for the DBAccess class and is suitable for Remote use. The Connection is also an Abstract Factory, subclassed into a concrete LocalConnection and a RemoteConnection interface. The RemoteConnection is a Remote interface implemented server-side by RemoteConnectionImpl. Phew.
To my mind, client logic should have no need to know anything about the database implementation, and certainly not about the database location. Its function is strictly to provide the GUI interface. In networked mode it will use the URL to obtain a RemoteConnection. In standalone mode, it will call a method in the DBServer to obtain a LocalConnection. In either case, it only knows it has a Connection.
This leaves the chore of configuring database location to the server (ie non-client) side logic. In network mode, things are straightforward. The Server has a GUI, where port and db location can be specified, and some stop and start buttons. defaults can be saved in properties.
Client is similarly straightforward. Client has a screen where url can be specified, and perhaps a connect button. again, save the defaults.
What to do in standalone mode? At a minimum, we still need to specify database location. Should we attempt to use the server gui for this? The server GUI has too much superfluous information with the port field and start/stop buttons... It would be confusing to the user.
Best would be simply to prompt for DB location in standalone mode. This could be done with a simple JDialog, or by adding conditional code to the server gui to adapt it between the two modes. I think it would be simpler just to have a separate input dialog for the special standalone case.
Well, that's as far as I've come on the issue. Would like to hear your current thinking and that of anyone else reading this thread because I've been struggling to come up with a satisfying solution to this for two days now.
Hope that helps, and thanks in advance for any further advice.
Thom