• 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Book record at GUI level

 
Bartender
Posts: 1558
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?
 
Ranch Hand
Posts: 590
Eclipse IDE Chrome 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.
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • 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.
 
Greenhorn
Posts: 23
Oracle Java Linux
  • 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
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • 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
Oracle Java Linux
  • 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: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • 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.
 
F is for finger. Can you stick your finger in your nose? Doesn't that feel nice? Now try this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic