I've just designed my database scheme and have tried to make it dynamic. E.g. if the scheme part of the database file changes I can still read in the database and create record and field options no problem.
What I am now going to do is have a set of constants that maps position x of my String to a field name. Then when I implement the following part of the interface a constant will say index 0 is name, index 1 is location etc. Then from then on I was going to work on names only.
The advantage of this way (as I see it) is that if the scheme changes all that has to be done is the constant mapping changed.
[edit: scrap that if the scheme changes I still wouldn't have to change anything, if the name and location fields were swapped round 0 would still map to name and 1 to location thus the client wouldn't break]
Am I doing too much here? Should I make it less dynamic?
[ January 25, 2005: Message edited by: Neil Renaud ] [ January 25, 2005: Message edited by: Neil Renaud ]
Neil Renaud<br /> <br />SCJP 1.4<br />SCWCD 1.4<br />SCJD - In progress since March 05
I've had similar thoughts, and decided that if the requirements document does not say the program "must" provide such flexibility, then it is probably beyond the scope of the project. There was a time when I tried to put every cool bell and whistle into my programs, but working for a huge company that hammered the warning "stop scope creep" into my skull on a daily basis for four years changed my approach.
Give a man a fish, he'll eat for one day. Teach a man to fish, he'll drink all your beer.
Cheers, Jeff (SCJP 1.4, SCJD in progress, if you can call that progress...)