• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: Trivial cosmetic verifications

 
Manoj Gundawar
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have few trivial doubts related to the cosmetics of the GUI and few others. I just want to check what is generally being followed. I dont want to get less marks just for following the unconventional trend.
Doubts:
1. Are you providing sorting capabilities in JTable?
(Once user click on the header, table will be sorted on that column)
2. About adding a new record. Are you keeping the records case sensitive?
In Contacor assignment, while adding a new contractor, if the record being added is already there (same name and location combination) but with different capitalization, will this new record be accepted?
3. Are you accepting numeric in name or location or skills? (I could not think of name or location, which can have number, but skill can have numbers, at least in software like Java2 etc. . I am not sure if home improvement ppl have something like that)
4. Is '.' acceptable in the rate field? for ex. 120.40$
Respond as and when get time, as these are quite trivial issues.
Thanks,
Manoj
[ October 09, 2003: Message edited by: Jmannu gundawar ]
 
Manoj Gundawar
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any suggestions?
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My own answers:
1. Yes.
2. Yes. (Actually all new records are accepted; I never throw DuplicateKeyException as it's undocumented and unnecessary in practice. Search on DuplicateKeyException as it's a long discussion.)
3. Yes. That is, my GUI doesn't allow these fields to be changed at all, and my DB performs no validation of these fields at all. If someone uses some other program to change these fields, I don't really care; not my concern. The only validations my DB performs are (a) is record number legitimate, (b) is cookie correct (if required), (c) is the number of fields correct (6), and (d) is each field length <= max field length. The only validation the GUI performs is for customer ID, because that's the only thing that can be edited.
4. Yes. (Not that I validate anyway, but...). Doesn't this appear in your sample file?
[ October 09, 2003: Message edited by: Jim Yingst ]
 
Manoj Gundawar
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jim,
Thanks for your comments.
Validation:
I guess we have different assignment. Mine is Contractor's, where I need to provide capability to add new contractor. So I need to do validation on all the fields before adding it to the DB.
DuplicateKeyException:
I went thru the previous discussion on DuplicateKey..But it was all intermixed interpretations and spiced with little confusion due to different assignments.
But I am quite clear about this and have to throw this exception, as the method signature is:
public int create(String[] data) throws DuplicateKeyException;
About 4th point: My sample file only has whole $ amount and not the fractional amount. So that's why I had this doubt.
Thanks,
Manoj
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Validation:
I guess we have different assignment.

No, I think we just interpret it differently. Which is OK. I'm on contractors too, version 2.1.1.
Mine is Contractor's, where I need to provide capability to add new contractor. So I need to do validation on all the fields before adding it to the DB.
We need to provide a create() method, but there's no particular validation requirement, and the GUI isn't required to actually call create() under any circumstances. Validation certainly could be useful for future enhancements later, but I don't think it's necessary now. (Except for customer ID field, which is the only thing the user can edit using my GUI.)
DuplicateKeyException:
I went thru the previous discussion on DuplicateKey..But it was all intermixed interpretations and spiced with little confusion due to different assignments.
But I am quite clear about this and have to throw this exception, as the method signature is:
public int create(String[] data) throws DuplicateKeyException;

I have the same signature. That doesn't say it must be thrown under any particular circumstances, only that it may be thrown by some implementations. Since no details are specified about keys, and the GUI can't create new records anyway, I chose not to spend time writing code for this. You're welcome to do otherwise, and it's certainly possible that B&S really do want you to check for duplicate keys - but they failed to communicate this. It's not a requirement, IMO, merely a reasonable possibility.
About 4th point: My sample file only has whole $ amount and not the fractional amount. So that's why I had this doubt.
OK, that's different between our assignments then. I'm not sure what I would do in your case. This is one reason I'm reluctant to put in validation for anything that isn't explicitly specified - you might reasonably guess that . is not allowed (for your assignment) but if B&S later on decide that they actually did want . to be allowed, the validation code gets in the way, and needs to be changed. I'd prefer not to bother coding things that aren't required and may cause complications later. In the real worlkd, I'd probably support more validation - but that's because in the real world we could usually get more feedback from our customer about what they really wanted.
[ October 10, 2003: Message edited by: Jim Yingst ]
 
Manoj Gundawar
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jim, You are right. I just went thru my GUI specifications again and it really dont mention about create or delete functionality. I kind of read between the lines..As these methods are provided in the interface.
I have provided ADD/Delete functionality in GUI. I am not sure if it will affect my grading (or fail me right away)
I spent quite a lot of time coding this part and really dont want to remove it. (it hurts to do so ) Not sure what to do now. May be will post an email to SUN.
Thanks for your inputs.
Manoj
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic