Hi again.
I am reading the "must" requirements to make sure that everything is clear in my application. However I found something that is bugging me a bit.
Your choice of RMI or serialized objects will not affect your grade, but no other approach is acceptable. In either case, it must accept an indication that a local database is to be used, in which case, the networking must be bypassed entirely. No authentication is required for database access.
I am using Roberto's approach and created an abstract listener. In my case this abstract listener gets a database connection, opens the main window and closes the configuration dialog. It is abtract because the getDBAccess() method is not implemented.
When the user starts the application he indicates in the console the running mode. Depending on the mode a ServerConfDialog, a ClientConfDialog or a StandaloneConfDialog will appear. Each one of the configuration windows has a contrete implementation of the abstract listener and adds it to its "Accept" button. This concrete implementation "implements" the getDBAccess() method.
Now for example, if I have a ClientConfDialog then I just implement the getServices method (in the concrete implementation of the button listener) retrieving a remote database connection. If I have a StandaloneConfWindow I retrieve a local database connection.
For the client mode:
What is worring me is the part of "
it must accept and indication that a local database is to be used". Which "indication" they are refering to?. In my case the only indication is when I run the application starter:
What I am starting to think is that they are saying they want me to implement a factory. The "indication" would be an enum or something similar.
What do you suggest in this case, is my "indication" at the start of the application enough or do I have to create a factory and pass a kind of enum to have an "indication" (although we could say that the getDBAccess is a factory by itself)?
Regards!!