JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
Blake Minghelli<br />SCWCD<br /> <br />"I'd put a quote here but I'm a non-conformist"
Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
I've been getting wary myself of using properties for this kind of work, since it a) implies a start/restart routine to bring in changes, and b) leaves a proper restart in the hands of correct editing. My recent work with a lot of Sun ONE products in particular makes me wonder if XML-everything for config files is such a cool idea.
Blake Minghelli<br />SCWCD<br /> <br />"I'd put a quote here but I'm a non-conformist"
Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Yes. The Charity Technology Trust raffle engine (see eg the current Royal British Legion raffle) uses a similar approach to define validation rules for various card types. As you don't see new types every day or even every year, the problems you rightly describe aren't very important in this case.Originally posted by Michael Ernest:
I had thought of a hashtable too, but never having used the approach myself I didn't mention it. Have you used this approach, Peter?
For our in-house controller, we implemented an auto-refresh by checking the configuration file timestamp every X seconds. This will read the new file and parse it into a new Configuration object. If an exception is thrown during the parsing and validation phase, this is logged and the new Configuration is discarded, leaving the old, working, configuration in its place. Only when the new configuration is valid it is actually installed.Originally posted by Blake Minghelli:
If you don't want to restart in order to change handlers then you could consider [...] an "auto-refreshing" properties object.
However, that would still leave you with your concern about improper editing...
Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
Originally posted by James Bowen:
I thought that an 'if' statement would be hard to maintain if new rules came along,
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
We begin by testing your absorbancy by exposing you to this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
|