----------------------------------<br />| SCJP, SCWCD, SCBCD, SCEA, SCJD |<br />----------------------------------
SCJP, SCJD, SCWCD, OCPJBCD
so I think that owner id can be a string made up of 8 digits, am I right or not?All numeric values are stored in the header information... All text values, and all fields (which are text only), contain only 8 bit characters... bla bla
SCJP 1.4, SCJD, OCE EJBD 6
can generate this owner id transparently to the user or should I get it from him by GUI input?
SCJP, SCJD, SCWCD, OCPJBCD
SCJP 1.4, SCJD, OCE EJBD 6
Originally posted by Mihai Radulescu:
Hi Lucy,
I don't know if the IllegalArgumentException is the right way to signal a malformed record, specially if this exception is a runtime one.
What I mean here is the runtime exception represents programming failures, that means the user must have the possibility to know how to test its actions - in your case the parameters.
Where you throw the IllegalArgumentException ? on your FileHandler or on your Data class ?
----------------------------------<br />| SCJP, SCWCD, SCBCD, SCEA, SCJD |<br />----------------------------------
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.
SCJP 1.4, SCJD, OCE EJBD 6
SCJP, SCJD, SCWCD, OCPJBCD
----------------------------------<br />| SCJP, SCWCD, SCBCD, SCEA, SCJD |<br />----------------------------------
I invented an TextField that allows only digit as input values.
SCJP, SCJD, SCWCD, OCPJBCD
----------------------------------<br />| SCJP, SCWCD, SCBCD, SCEA, SCJD |<br />----------------------------------
----------------------------------<br />| SCJP, SCWCD, SCBCD, SCEA, SCJD |<br />----------------------------------
SCJP, SCJD, SCWCD, OCPJBCD
----------------------------------<br />| SCJP, SCWCD, SCBCD, SCEA, SCJD |<br />----------------------------------
McFinnigan? Never heard of him. Nobody here but us chickens...<br /> <br />SCJP for Java 1.4<br />SCJD for Java 5.0
Originally posted by Jeremy Botha:
This raises an interesting point.
Two separate ways of handing out-of-bounds data have been presented. One is to throw a runtime exception, another to do validation on the data.
I personally prefer the second method. I put input validation on any methods which capture user-entered data. If I'm especially paranoid and believe that my data layer will be accessed by other means further along the product lifecycle I will put validation in the data layer as well.
Does anyone else do this? Or is it more 'correct' to throw IllegalArgumentException and other runtime exceptions? I look at these as indications that something has gone VERY wrong; I don't believe that Exceptions should be used for general data validation etc.
comments? thoughts? Should this be split to a new thread?
J
SCJP<br />SCJD
Consider Paul's rocket mass heater. |