General J2EE: General Architecture Question
- Posted by: Madhav Deverkonda
- Posted on: June 23 2004 10:39 EDT
Need to show a number (tracking number) on every page of my web application. This number is referenced by the pageID. There is a style, which checks for the pageID and displays this appropriate tracking number. More than one page can have the same tracking number. PageIDs are prone to frequent changes with in the development phase not even between releases.
Note: No App Server involved.
tracking numbers are put in a property file, where it is keyed with pageID.
tracking numbers with pageIDs are put into database. Style which prints the tracking numbers uses some helper class and gets the appropriate tracking number.
tracking numbers which are stored in database are loaded when the server comes up as a singleton object and Tracking Numbers style uses that object just to get appropriate tracking number (which is pre loaded).
Option-2 is totally ruled out. The subtle difference between option-1 and option-3 is property file vs database.
I understand that all metadata type of information should be put into property file and data should be put into database. But in this case where the pageIds and Job numbers are frequently changed, and development team does not have good control on database data, I would prefer property file.
Can anybody else second my preference? If yes please give another good reasoning to convince my design to rest of the team. If not please tell me why not.
Your help is greatly appreciated.
I would use a ResourceBundle (property file). The pageID would be the key, and you would define the value. You could use jstl:
<fmt:bundle basename="yourFile">BTW, what do you mean by pageID?