Properties file or a Constants Class 2005-01-12 - By KR Kumar
Back Guys,
Thanx a lot to all of you guys for the help. I got it. For example, the name and path of configuration can change at any time, in that case name and path of the file should be in a property file and on the other side some application constants like SUCCESS and FAILURE which will not change, should be put in the Constants java class.
Is that right?
-- --Original Message-- -- From: A mailing list for Java(tm) 2 Platform, Enterprise Edition [mailto:J2EE-INTEREST@(protected)] On Behalf Of Jones, Douglas 1 Sent: Wednesday, January 12, 2005 8:05 PM To: J2EE-INTEREST@(protected) Subject: Re: Properties file or a Constants Class
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".
DISCLAIMER: This message contains privileged and confidential information and is intended only for the individual named.If you are not the intended recipient you should not disseminate,distribute,store,print, copy or deliver this message.Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted ,corrupted,lost,destroyed,arrive late or incomplete or contain viruses.The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version.
==========================================================================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".
|
|