File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Database and extensibility Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Database and extensibility" Watch "Database and extensibility" New topic

Database and extensibility

Ranch Hand

Joined: Jul 24, 2002
Posts: 379
Hi, when reading my db data, I convert all bytes to characters and it works well. However, shall we perform a check that the field value is numeric/not numeric? I mean this for extensibility. If we give for granted that each field value is a string, what would it happen tomorrow if a numeric field would be added?
Am I asking too many questions?

Marco Tedone<br />SCJP1.4,SCJP5,SCBCD,SCWCD
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
Don't fall into the trap of trying to make sure that anything that can happen will be handled by your program. If something isn't stated in the assignment spec, just leave it alone. Not only will you not get any extra points for doing extra stuff, but you also open yourself up to extra bugs and issues which can bring down your score or even fail you.
There is a balance between making a good design and doing everything possible. Lot of people hardcode the db schema information into the data access class, while others made some sort of meta information class to use. Either approach seems to be valid, but keep it tempered. Don't get carried away.
Any time you hear your brain mutter "extensibility" kick it. (Or at least question it).

Vishwa Kumba
Ranch Hand

Joined: Aug 27, 2003
Posts: 1066
I agree with Nathan.
Some time before, when I had asked similar questions, Andrew had suggested me XP's YAGNI Approach . Do read it. It is an interesting view that sounds logical for practial projects
I agree. Here's the link:
subject: Database and extensibility
It's not a secret anymore!