• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Book record at GUI level

 
Anayonkar Shivalkar
Bartender
Posts: 1557
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Currently, at GUI level, I'm planning to do following:

1) User selects a record and hits 'book/reserve' button.
2) User enters new data (only 1 field can be changed).
3) User hits OK.

Now, what happens if another user actually books the record in between? Since I've implemented a thin client, actual 'lock-update-unlock' will happen after user hits OK button. But if record is already booked by other user after this user enters data (and before user hits OK button), what should I do?

I'm planning to throw RNFE with different message (say record is already reserved etc.) and depending on the message from RNFE, I'll show respective message box at GUI level. I'll also have a 'refresh' button at GUI. Is it fine?
 
Sean Keane
Ranch Hand
Posts: 582
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anayonkar Shivalkar wrote:But if record is already booked by other user after this user enters data (and before user hits OK button), what should I do?


Tell the user that the record is no longer available. Then refresh the table contents so that they can see that the room is booked.
 
Roel De Nijs
Sheriff
Posts: 10411
133
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sean Keane wrote:Tell the user that the record is no longer available. Then refresh the table contents so that they can see that the room is booked.

Exactly what I did.
 
Dmitry Kotlov
Greenhorn
Posts: 23
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Roel!
Just a small question about subject. I've opted to thin client.
What do you think where is the most appropriate place to check the availability of a record at business layer or at gui layer? I'm inclined to think that the business layer is better. What can you say?

Thanks,
Dmitry
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dmitry Kotlov wrote:What do you think where is the most appropriate place to check the availability of a record at business layer or at gui layer?


Well, if you put it in the presentation layer, then you would lose portability. If you opt to use your business model in another scenario (a web app, for instance), then you would have to write your code again in your controllers (servlets, ClickHandlers (GWT), ActionListeners (Echo3), @Controllers (JSF) and so on). Other then that, the presentation layer isn't appropriate to execute any business rules.
 
Dmitry Kotlov
Greenhorn
Posts: 23
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roberto Perillo wrote:
Dmitry Kotlov wrote:What do you think where is the most appropriate place to check the availability of a record at business layer or at gui layer?


Well, if you put it in the presentation layer, then you would lose portability. If you opt to use your business model in another scenario (a web app, for instance), then you would have to write your code again in your controllers (servlets, ClickHandlers (GWT), ActionListeners (Echo3), @Controllers (JSF) and so on). Other then that, the presentation layer isn't appropriate to execute any business rules.


Thanks,
Roberto!
You've approved my guesses!!

Good luck and have a nice day!
 
Roel De Nijs
Sheriff
Posts: 10411
133
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dmitry Kotlov wrote:What do you think where is the most appropriate place to check the availability of a record at business layer or at gui layer? I'm inclined to think that the business layer is better. What can you say?

Checking for room (contractor) availability is clearly a business requirement, so that's something you put in the business layer. With a thin client your GUI will be very stupid and contains very little to none business logic.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic