Re: Business Calendar
On 5/9/2010 1:41 PM, Lew wrote:
Arne Vajh??j wrote:
I will expect most places to have algorithmic rules for
holidays that can be implemented.
Lew wrote:
Good Friday.
The algorithms are horrid. Lookups are simple and straightforward,
Arne Vajh??j wrote:
You get simple code at the cost of a maintenance problem.
Calling it a "problem" seems rather grandiose. Either way, if the rules
change you have to change something. If you have the rules in a
database, you don't need to recompile and redeploy the application. If
you have the rules in code, that's more of a problem. Then you have to
do regression testing, schedule an upgrade, and all that. Much better to
externalize it.
To look at it another way, why not use the same solution for
holidays as is used for the start and end dates of summer time
adjustments (where observed)? They, too, are region-dependent,
subject to legislative interference, and not easy to predict more
than a year or so in advance. (Remember the trouble that ensued a
few years ago when the USA rules changed? Older Java versions had
the old rules hard-wired in code and were difficult to deal with;
newer versions used tables and were updated easily.)
--
Eric Sosman
esosman@ieee-dot-org.invalid