• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX : Contractor

 
Manoj Gundawar
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have quite a silly question. But I need to clear my doubt, else I wont be able to sleep
As per the specification, if contractor is already booked, he/she can't be booked again. My questions are:
1. Should it be handled at client side, even before making a call to UPDATE or BOOK method (in case some people are not exposing the LOCK-->UPDATE->UNLOCK to the client)
====> But I dont think this approach is good design, as Client should not make such decision.
2. Then if it is being decided in the UPDATE method of the DATA class (which implemets the DB interface provided by SUN) , how you guys are doing it?
2.a => Are you throwing new exception? (like recordBookedException etc)
2.a.a==> if yes, how it fits with the interface method, as interface UPDATE method is not throwing this exception. Can we add new Exception to the interface?
2.b==> If you are not throwing exception, how are you handling it?
Please let me know if there is any alternative to these choices.
Thanks,
Manoj
 
Manoj Gundawar
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any clues?
 
Bharat Ruparel
Ranch Hand
Posts: 493
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Jmannu,
I do want you to get a good night's sleep if I can help it. Off course, I may be wrong and you might end-up getting a bigger headache! Anyway, here we go...
I have URLyBird 1.3.1 but conceptually both assignments are similar: we need to book a room and you have to book a contractor. What I have done is that I check or validate at the client side when the user presses the Book button. This way bad data is not sent to the server as much as I can help it. Seems to work well.
Hope this helps! Nighty night.
Bharat
 
Manoj Gundawar
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bharat,
Yes, that is one of the options. But I thought this is kind of validation which server is supposed to do. It is very easy to do it on the client side though. No need to take care of new exception then.
Anyway, thanks. Dont take the sleep part very seriously.
Manoj
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic