Properties file or a Constants Class 2005-01-12 - By Jones, Douglas 1
Back True, this issue really does focus around the need for values that change frequently or something that is designed to not change through the life of the program. I figured hearing an anecdote about how to the prefs file was implemented might be useful, even though it doesn't really help solve what method is better for the OP's needs. In reality, it seems like some things that people tell you will be constant forever have a tendency to change, at least when writing the types of applications that I write :)
-- Doug Jones Co-Op Web Developer douglas.1.jones@(protected)
-- --Original Message-- -- From: A mailing list for Java(tm) 2 Platform, Enterprise Edition [mailto:J2EE-INTEREST@(protected)]On Behalf Of Darryl Pierce Sent: Wednesday, January 12, 2005 9:27 AM To: J2EE-INTEREST@(protected) Subject: Re: Properties file or a Constants Class
On Wed, 12 Jan 2005 09:12:55 -0500, Jones, Douglas 1 <douglas.1.jones@(protected)> wrote: > The way my group does things is to have a key value pair properties file. > We have a class that loads this file and puts the keys and values into a > hash table for easy reference later. Each servlet that needs this file is > responsible for loading the file itself. The main advantage to this is > being able to change values without having to restart the server.
I think the confusion here is that the OP asked about _constants_. What I and at least one other person described was viewing the solution from the point of view of the OP's needs; i.e., if the values will change, put them into a properties file, and if they won't, put them into an interface. The OP hasn't clarified their needs yet.
-- Darryl L. Pierce <mcpierce@(protected)> Visit the Infobahn Offramp: <http://mcpierce.mypage.org>
======================================================================== === To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
=========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
|
|