Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Updating the GUI Table

 
Nils Berg
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone.

I'm not sure how to keep the client GUI updated with respect to the server data. I mean when client1 reservates a record how should the client2 be notified about the new record status?

1/ current quick/dirty solution - popup a message on client2, "this record is already booked", then force a reread from server and the record will now be updated with customer id number that client1 entered.

2/Or do I have to implement some kind of RMI callback so all clients always are updated with respect to the server. I think this a bit overkill but not sure.

any suggestions?

BR Nils
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nils

I think that this notification mechanism goes beyond the certification purpose. So I also think that is enough to document your decision.
On the other side if you have a middle layer you can do a small record check here (lets say every time when the record is accessed) and if the record differs then re-read. But once more I think that this goes beyond certification purpose.

I woander what the other ranchers think about ?

Regards M.
[ January 04, 2007: Message edited by: Mihai Radulescu ]
 
Kalle Tjarnlund
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I have done as the quick/dirty solution. I can agree that this could be considered a bit "dirty" but still there are commercial apps that works this way. Also I think that this solution is a quite good solution regarding that the code should not be too complex. One could also argue that it could be a bit confusing for the user if (s)he was just about to book a record and suddenly it would have a customer id assigned to it..

Best Regards,
Kalle
 
Nils Berg
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your replies.

I think I will stick to the simple solution.

Time to cleanup code then, and do the hardest task documentation.

BR Nils
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kalle,

I really don get it, how do you solve this problem ? Can you detaliate a little ?
 
Kalle Tjarnlund
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Before I update the record I compare the record which I want to book with the record present in the database. If they don't match I just throw an exception which is caught by the GUI. The GUI notifies the user and updates the record with the latest data from the database. The "book room" method is located in my service layer and a bit simplified it does the following:

1. Lock record
2. Compare records -> If not equal throw exception
3. Update record with new customer id
4. Release lock

Best Regards,
Kalle
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic