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

The owner field

 
Yuan Ye
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
owner: "The id value (an 8 digit number) of the customer who has booked this. Note that for this application, you should assume that customers and CSRs know their customer ids. The system you are writing does not interact with these numbers, rather it simply records them. If this field is all blanks, the record is available for sale."
Above is the description of the owner field in my assignment. I have two questions about it.
1) Does it mean I can't make my lock rely on the id value?
2) When I write the client GUI, if the client want to book a record, does it mean the client must fill in this field before the book operation?
Should I valid the format of this number in my program?
Thanks for your help.
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12014
220
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Peter,
1) Does it mean I can't make my lock rely on the id value?

There should be no relationship between the lock and the ID.
2) When I write the client GUI, if the client want to book a record, does it mean the client must fill in this field before the book operation?

Yes.
Should I valid the format of this number in my program?

I think that would be a very good idea.
You could validate it
  • while the user is entering the data,
  • after they have clicked the "book" button (or whatever your button is called)
  • on the server before committing the update


  • Or any combination of the three.
    Note: If you are writing a generic "database" server rather than a "contractors booking" or "hotel booking" server, then the last option may not be possible to you.
    Regards, Andrew
     
    Yuan Ye
    Ranch Hand
    Posts: 172
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks. That clears a lot.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic