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 / April 2007

Tip: Looking for answers? Try searching our database.

Configuration File and Design

Thread view: 
Jason Cavett - 12 Apr 2007 15:22 GMT
I am somewhat stumped on how to implement a component into my
application.  Basically, I already have a ConfigurationFile object
that I read in from a file when my application starts and write out to
when my application closes.  I can also update that ConfigurationFile
object from an options dialog.

The issue I'm having is that I'm not sure (from a design perspective)
the best way to update the various components that are affected when
the ConfigurationFile changes.  I have three problems/questions:

1. I want the system to be updated (relatively) immediately after the
changes are applied.
2. I considered using the Observable pattern to do this, but it seems
rather clunky because there are quite a few components in the system
that would need to observe the ConfigurationFile.  I'm not even sure I
like the ConfigurationFile being an Observable object in the first
place.  Do you think this is a good idea?
3. Would it be beneficial to make the ConfigurationFile a Singleton in
this sort of situation?

This is the first time I've ever run across "global options" like
this, so I hope my questions make sense.

Thanks
Ed Kirwan - 12 Apr 2007 15:38 GMT
> I am somewhat stumped on how to implement a component into my
> application.  Basically, I already have a ConfigurationFile object
[quoted text clipped - 20 lines]
>
> Thanks

FWIW, I tend to use the, "Global options," you mention and have each
behaviour read these options without caching, so that the behaviour will
change once the option values change.

For example, see:
http://www.edmundkirwan.com/servlet/fractal/cs1/frac-cs110.html

Of course, if changing an option could affect that way something static
has already been done (e.g., changing an option could change the
background photo in an app, and that background is only drawn when the
app starts) then I'd have thought the observer pattern would be the way
to go.

.ed

Signature

www.EdmundKirwan.com - Home of The Fractal Class Composition.

Download Fractality, free Java code analyzer:
www.EdmundKirwan.com/servlet/fractal/frac-page130.html



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.