Technique for managing constants and database references

J

JIm Smith

I have a large application which has a number of cases where certain
constants exist as both java "static final int" and in a database table of
the general form (id, shortname, longdescription...), where the id should
correspond with the java constant. Unfortunately, because things have to be
maintained in two places, and people are not perfect (damn them!), things
can get out of sync.

I'm looking for a way to unify the two somehow so there is a single point of
maintenance - the database.

I have one or two ideas of my own, but I would like to know if there are
useful techniques for this already documented.

TIA

Jim Smith
 
V

VisionSet

JIm Smith said:
I have a large application which has a number of cases where certain
constants exist as both java "static final int" and in a database table of
the general form (id, shortname, longdescription...), where the id should
correspond with the java constant. Unfortunately, because things have to be
maintained in two places, and people are not perfect (damn them!), things
can get out of sync.

I'm looking for a way to unify the two somehow so there is a single point of
maintenance - the database.

I have one or two ideas of my own, but I would like to know if there are
useful techniques for this already documented.

A class that maps to your contstant table, instantiating the rows at start
up?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top