Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2005

Tip: Looking for answers? Try searching our database.

When to use Properties

Thread view: 
sampsonyee@gmail.com - 15 Nov 2005 14:02 GMT
I am just getting into Java, so I am still learning methodologies.

My current project is to automate publishing documents that come from
another system.  Everyday there would be .txt and .pdf files copied to
a folder.  I would be publishing this files to a CMS using an
third-party SDK.  The files coming in would always be the same name
aside from a date in the filename.  The files would need to be
specified to be published to different folders, IE:

file1_20051115.txt  ===> folder1
file2_20051115.pdf ===> folder1
file3_20051115.txt ===> folder2

The destination folder would always be the same for each corresponding
file.  My question is, should I use an array with all the file names
and its corresponding folder names? or should I use a properties file?

Thanks in advance.
Paul Tomblin - 15 Nov 2005 14:10 GMT
In a previous article, sampsonyee@gmail.com said:
>The destination folder would always be the same for each corresponding
>file.  My question is, should I use an array with all the file names
>and its corresponding folder names? or should I use a properties file?

Can you foresee adding file names in the future?  Or changing the mapping?
If there is even the slightest possibility of that, don't you think it
would be better to NOT have to recompile the program to make that change?

On the other hand, having a file with the mapping means that anybody with
write access to the file can change the mapping.  That may or may not be a
good thing, depending on your circumstances.

Signature

Paul Tomblin <ptomblin@xcski.com> http://xcski.com/blogs/pt/
I assume HR did send out the ad I wanted, not "apply for a cool job if
you're a clueless f.ck".
             -- The Flying Hamster, on the receiving end of too many CVs

Robert Klemme - 15 Nov 2005 15:33 GMT
> In a previous article, sampsonyee@gmail.com said:
>> The destination folder would always be the same for each
[quoted text clipped - 10 lines]
> with write access to the file can change the mapping.  That may or
> may not be a good thing, depending on your circumstances.

You should also consider the application's architecture and deployment.
Is it GUI based?  Is it a demon or batch run?  Will you add more
configuration options in the future?  Are they complex? ...

   robert
Roedy Green - 15 Nov 2005 18:02 GMT
>file1_20051115.txt  ===> folder1
>file2_20051115.pdf ===> folder1
[quoted text clipped - 3 lines]
>file.  My question is, should I use an array with all the file names
>and its corresponding folder names? or should I use a properties file?

sounds to me like you have an algorithm. Just use that to determine
the destination folder.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.