Business Calendar

O

olegkon

Hi,

May not be exactly for that thread.

I am looking for some Web Service / JavaBean / Java lib
which would be able to determine whether particular day (e.g. today)
is a Business Day in Financial industry
(e.g. Banking) and be callable from Java program.

Any advise is very appreciated.


Thank you in advance,
Oleg.
 
L

Lew

olegkon said:
May not be exactly for that thread.

I am looking for some Web Service / JavaBean / Java lib
which would be able to determine whether particular day (e.g. today)
is a Business Day in Financial industry
(e.g. Banking) and be callable from Java program.

Any advise is very appreciated.

It's easiest to set up a database of dates and their attributes. The
definition of what constitutes a "business day" will vary from
organization to organization and from project to project. Even if
there were such a library, and I don't know of one, it probably
wouldn't match your requirement exactly.

Create a database table similar to:

CREATE TABLE day
{
day DATE NOT NULL PRIMARY KEY,
weekday CHAR (1) CHECK weekday IN ('T', 'F'),
weekend CHAR (1) CHECK weekend IN ('T', 'F'),
holiday CHAR (1) CHECK holiday IN ('T', 'F'),
busiday CHAR (1) CHECK busiday IN ('T', 'F')
);

Populate it with a few decades' worth of days. That's only about
36,525 rows per century.
 
A

Arne Vajhøj

I am looking for some Web Service / JavaBean / Java lib
which would be able to determine whether particular day (e.g. today)
is a Business Day in Financial industry
(e.g. Banking) and be callable from Java program.

That is country specific.

And I am skeptical about whether you can find something
like that.

Find the rules for your country and implement them.

Arne
 
E

Eric Sosman

That is country specific.

It's even more specific than that. I live in the United States,
in the Commonwealth of Massachusetts. In these parts, the Monday
closest to April 19 is a holiday (Patriots' Day) commemorating the
initial hostilities of the American Revolution. But elsewhere in
the country, the occasion goes largely unobserved: So it's a holiday
here and a "business day" most everywhere else.

Even on the holiday, some businesses operate and some do not.
Federal government offices are open, state and city offices are
closed (you can't appeal your real estate tax assessment at City
Hall, but you can mail the tax payment via the Federally-operated
Postal Service). Private businesses are open or closed in accordance
with a crazy quilt of regulation and tradition. A foot race called
the Boston Marathon runs through my town that day, bringing nearly
everything but the runners to a halt -- except that the policemen,
firemen, and emergency personnel of all kinds are *all* on duty;
it's no holiday for them ...

Similar variations can be found in other countries, too. I'm
told, for example, that in Germany the official holiday system takes
note of a person's religion: A day that is a business day for Catholics
may be a holiday for Protestants or Jews, and vice versa.
 
A

Arne Vajhøj

It's even more specific than that. I live in the United States,
in the Commonwealth of Massachusetts. In these parts, the Monday
closest to April 19 is a holiday (Patriots' Day) commemorating the
initial hostilities of the American Revolution. But elsewhere in
the country, the occasion goes largely unobserved: So it's a holiday
here and a "business day" most everywhere else.

Even on the holiday, some businesses operate and some do not.
Federal government offices are open, state and city offices are
closed (you can't appeal your real estate tax assessment at City
Hall, but you can mail the tax payment via the Federally-operated
Postal Service). Private businesses are open or closed in accordance
with a crazy quilt of regulation and tradition. A foot race called
the Boston Marathon runs through my town that day, bringing nearly
everything but the runners to a halt -- except that the policemen,
firemen, and emergency personnel of all kinds are *all* on duty;
it's no holiday for them ...

Similar variations can be found in other countries, too. I'm
told, for example, that in Germany the official holiday system takes
note of a person's religion: A day that is a business day for Catholics
may be a holiday for Protestants or Jews, and vice versa.

I stand corrected.

I still believe that the correct approach is:

#Find the rules for your country and implement them.

just for the relevant entity instead of the country.

I will expect most places to have algorithmic rules for
holidays that can be implemented.

"the Monday closest to April 19" is certainly something that
can be found for any year.

Arne
 
L

Lew

Arne said:
I will expect most places to have algorithmic rules for
holidays that can be implemented.

Good Friday.

The algorithms are horrid. Lookups are simple and straightforward, and easily
extended to handle multiple jurisdictions simultaneously.
 
A

Arne Vajhøj

Good Friday.

The algorithms are horrid. Lookups are simple and straightforward,

You get simple code at the cost of a maintenance problem.
and
easily extended to handle multiple jurisdictions simultaneously.

I can't see a problem with extending the algorithmic approach to
handle multiple jurisdictions.

Arne
 
L

Lew

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.
 
E

Eric Sosman

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.)
 
Joined
May 6, 2010
Messages
2
Reaction score
0
Guys,

I am talking about business days by which all financial institutions
(Wall St., stock exchanges, banks, etc. live)
in NYC (and possibly all US) live, there should be something fairly common.

I am not looking for something exotic at all.

TIA,
Oleg.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,056
Members
48,769
Latest member
Clifft

Latest Threads

Top