• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Book record at GUI level

 
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic