aspose file tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Is needed  to check the length of fields? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "Is needed  to check the length of fields?" Watch "Is needed  to check the length of fields?" New topic
Author

Is needed to check the length of fields?

Pedro Su�rez
Greenhorn

Joined: Aug 03, 2007
Posts: 2
HI,

I'm writing an Object Value for holding any record I read from the file. But I'm unsure if I should check the length of the fields with the 'sets' methods. This forced me to throw an exception if the length is exceeded. Also, since the constructor should checks the values of fields as well, I don't know if I could call the sets methods from the constructor without breaking the sun code convention rules (calling the sets methods from the constructor I avoid repeat the check code that is written in the sets methods).

Thanks a lot!.
Romeo Kienzler
Greenhorn

Joined: Aug 15, 2007
Posts: 14
Hi Pedro,
please see this thread.

So I think you have to validate. The only question ist WHERE to validate. In the DTOs or in the database itself.

Greetings,
Romeo
[ August 15, 2007: Message edited by: Romeo Kienzler ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is needed to check the length of fields?
 
Similar Threads
How to validate text fields ?
Reading in db file
Implementing Comparable, crafting compareTo with Set class
Static initilaization vs. Constructor initilaization
static insights?