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 Dynamic Database Scheme 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 "Dynamic Database Scheme" Watch "Dynamic Database Scheme" New topic

Dynamic Database Scheme

Neil Renaud

Joined: Jan 19, 2005
Posts: 15
Hi ppl,

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
Jeff Bosch
Ranch Hand

Joined: Jul 30, 2003
Posts: 805
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...)
I agree. Here's the link:
subject: Dynamic Database Scheme
It's not a secret anymore!