• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

booking update -> refresh ALL or current....

 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers,
the user needs to
1.do a search before booking any flight.
2. select row and say book
3.provide the required seats
4. refresh the data after a successful book
my query is:-
1. does the refresh at step 4. needs to be refreshed with all the flights data or only the refresh of whatever record the user is shown for booking.
for example,
1. the user selects the carrier='SpeedyAir'
2. user recieves 4 records
3. user selects the first record and say book.
4. controller dispatches to the Model
5. on succesful booking, Model says populate the View and sens all data (Observable-Observer)
6. does the view needs to populate a)only the bookable data(for the current search), shown to the user or b)does it populate all the flight information(24 records)
option b looks sooooo silly , even then, like to confirm from you.
Moral of the story: - does the View needs to maintain the same records even after a successful booking, but updated with the booked data and not all records!
as i was saying , if there is only one record shown for booking, after a search and the user gets 24 records on successful booking, it looks silly (atleast i think so ).
statement:-
so if n is the number of records shown for booking , then after booking the same n records should be displayed.
approach 1: the same n records shown for booking will be shown after booking, but only the booked record will be updated.
approach 2: the same n records shown for booking will be shown after booking, but all the records shown for booking will be updated.
i like approach 2. there is a "Good" chance that the user may want to book any of the remaining records shown to him and it is good to get it updated tooo.
kindly help in with your comments!!!
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have decided to update only the booked record in the booking selection shown .
say if there are 4 records shown and if the user selects the 4th record and say book, then only the 4th record is updated.
does this makes sense. anyone???
 
Miguel Roque
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
I think that you should update the entire table as if you are working in network mode, someone could have booked flights in row 3 and if you refresh only row 4 no updates are made so your client can go to row 3 and try to reserve seats in a flight that doesn't have any seat left.
Miguel
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Miguel Roque:
Hi.
I think that you should update the entire table as if you are working in network mode, someone could have booked flights in row 3 and if you refresh only row 4 no updates are made so your client can go to row 3 and try to reserve seats in a flight that doesn't have any seat left.
Miguel

Hi Miguel, thanks for the update.
but my .002 cents of thought of why i am not updating the bookable records(records shown to the user after a search):-
1) because i have changed my model to send the update "book update" for only the record currently booked. by doing this, the model need NOT read the whole database and broadcast all the records. saving hell lot of time. That too, when the Model, does a whole record search and broadcasts, then it is not at all a Observable-Observer(only the state change needs to get broadcasted. for booking the state change is the booked data).
2) even if the Model does a broadcast of all the records and the view gets updated with the data for the displayed records. there is NO guarentee that the records are current before it reaches the View.
scenerio:-
1. the View says book me the 4th record
2. the Model books the 4th record with the required seats
3. Model broadcasts all records
4. someone modified the 3rd record
5. View gets updated with all the new records, whereas the 3rd record is change behind the back ofthe user
altogether, updating only the booked record is more simple,and soooooooo good and i am soooo happy with this kind of update.
if i am NOT going to guarentee that, whatever the user sees is up-to-date record, then there is no point in updating the remaining records.
i appreciate you comments and all comments are welcome, as always.
[ March 24, 2003: Message edited by: aadhi agathi ]
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

if i am NOT going to guarentee that, whatever the user sees is up-to-date record, then there is no point in updating the remaining records.

futher update regarding this, even if the "records displayed" as available seats 0, still he can seek some required seats greater than 1 to book. because my View is a dumber and i am using an optimistic locking.
[ March 24, 2003: Message edited by: aadhi agathi ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic