Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Overall Architecture Urgent!!!

 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
According to Sun's specification:
"The application is a traditional Client/Server system.There are three key parts:
1)The server side database with network server functionality
2)The client-side graphical user interface
3)The client side database client part that handles the networking on behalf of the
user interface.
Point 1:- According to me on server "db.db" file will exist which enable users to access data from database file.
Point 2:- With the help of GUI we will connect to the network server and access data from "db.db" file.
Point 3:- Here i am confused, is one more "db.db" file will exist on the GUI side when our application is in non-network mode.
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, there will be two different copies of db.db. One with the server, one for use in local mode
Mark
 
Anurag Mishra
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mark
But i couldn't understand that when the user books a seat on remote mode and than moves on to local mode, than how the seats will be decreased accordingly in the local database.
Anurag Mishra
 
Mark Spritzler
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That would never happen. If you are using the remote database, all the reading, writing is done on that file. If you are using the local database, only the local file gets changed. No switching in the middle.
Imagine the local version is on someone's laptop, not connected to any other machine or network. How will that person book a flight, except with his/her only copy.
That is the point of local vs. remote.
Mark
 
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark,
From reading your posts I found you mentioned that you used a facade to the DataClient. I too do not want to use the DataClient methods directly from my gui components but want them to talk to a FNBClient that will book seats and provide other convinience methods for them. Could you expand on your implementation? Thanks.
 
Mark Spritzler
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Could you expand on your implementation?


Tough question. I am a big proponent of small methods. I don't think I had a method that was larger than 10-12 lines of code. So in my Facade, I thought what are the things I want the client to call on to the server, and what are the simple steps that the method needs to do. These are calls to the DataAccess Interface.
I have only 6 public methods, and 4 private methods
Public
BookFlight(flightNumber, numberOfPassengers)
getAvailableSeats(flightNumber)
criteriaFind(criteria)
getAirlines()
getArrivalAirports()
getDepartureAirports()
Private
getFieldData(String fieldName, DataInfo record)
getFieldDataArray(String fieldName)
setFieldData(DataInfo record, String fieldName, String newValue)
saveBookedData(DataInfo flight, String flightNumber, int numberOfPassengers)
And I went from there. Hope that helps, but I don't want to give everything away.
Mark
 
Kalichar Rangantittu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark, I see everyone using a combo box for the fields. This looks fine but isnt the cost of looping through the entire record, to get the names of the fields rather expensive to do. I was initially concerned about the addition/deletion of a new record. However, if that were to happen everything would go haywire as then records would need to be updated etc....
Can one get by without the combo box???
 
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you can get by w/o it, but the combo box
is part of good HCI for sure, well in my opinion at least!
 
Mark Spritzler
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kalichar, yes in a big database the looping through the records would be very expensive, but if it was a larger database, you wouldn't be using these simple Data classes that Sun designed, you would be in a database that had indexes and such.
And as far as adding and deleting records are concerned, that will not happen in your assignment. It is not requirement for your GUI to have that functionality.
The reason why those methods are in the Data Class is for the older version of the assignment where you had to write a conversion program to move a text file of data into the db.db file.
The toughest thing with this assignment is to not over analyze the requirements. Once I got over that I took the easy way, but still took the time to make it neat and clean. Well almost all the time. I realize now that I should have seperated the Data class files into the data package, and had the RMI Connection, etc in a server package. Maybe that is where I lost the 4 points.
Oh well, to late now
Mark
 
What do you have to say for yourself? Hmmm? Anything? And you call yourself a tiny ad.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic