arvindpopli

Greenhorn
+ Follow
since Jul 06, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by arvindpopli

Congratulation, Rick.
-Arvind
Thanks, Rick. And congratulations on clearing the SCJD.
-Arvind
My overall architecture for the FBN Project is: (RMI implementation)
I modularized the design by having the Database and Communication functionality operations as two separate classes, so that the GUI or the Client shall not have to be changed when either the Database or the Communications operation is changed or modified.

- DATABASE functionality: (database operations)
*Database interface -> which has definitions of all the public methods of the Data Class along with lock, unlock and criteriaFind method definitions.
*DatabaseImpl Class -> extends Data class and implements the Database interface. Overrides lock, unlock methods and implements the criteriaFind method. (so basically I do not change anything in the Data class).

- COMMUNICATION functionality: (Flight Services such as booking, search Flights etc..)
*FlightServices interface -> which has communication method definitions like: getInitialFlightInformation(...), searchFlight(...), bookFlight(...). And all of these methods throw only Exceptions.
*FlightServicesRemoteImpl class extends UnicastRemoteObject implements FlightServices and throws RemoteExceptions -> handles the communication part btwn clients and remote server. Has a reference to DatabaseImpl object to access the Database on the server.
*FlightServicesLocalImpl class implements FlightServices and throws Exception -> handles the communication part btwn clients and local server, bypasses RMI. Has a reference to DatabaseImpl object to access the Database locally.
Note: The reason for having two identical classes: FlightServicesRemoteImpl, FlightServicesLocalImpl (excepting the constructors) that the Remote throws RemoteExceptions and the Local throws only Exceptions.

- CLIENT: (currently non-GUI)
if (networkMode.equals("local")) {
FlightServicesLocalImpl fsLocal = new FlightServicesLocalImpl();
//Get LOCAL Initial Flight Information: ORIGIN, DESTINATION
System.out.println("LOCAL:: Getting Initial Flight Information: " + fsLocal.getInitFlightInfo());
.
.
.
}
//REMOTE MODE
else if (networkMode.equals("remote")) {
if(System.getSecurityManager() == null) {
System.setSecurityManager( new RMISecurityManager() );
}
String name = "//" + host + ":" + portno + "/FlightServices";
FlightServices fsRemote = (FlightServices)Naming.lookup(name);
//Get Initial Flight Information: ORIGIN, DESTINATION
System.out.println("Getting REMOTE Initial Flight Information: fsRemote.getInitFlightInfo());
.
.
.
}

- SERVER:
Binds the FlightServicesRemoteImpl object with the main Server Object.
Now my question is :
According to one of the project specs, one has to implement: "client-side database client part that handles the networking on behalf of the user interface". Am i doing the right thing in the design above ?

Any advice shall be appreciated
Thanks,
Arvind.

Hi Safarole,
Did u asked the USER to specify or enter the location of the data file (db.db) ?
Thanks,
Arvind
Congratulations SAFROLE. Good job, simple and elegant.
QUESTION: In your search did u allowed the user to enter the Carrier Name also, besides Origin and Destination ?
Thanks,
Arvind.