design question - initialising static fields via a singleton?

From: bugbear (pwomack_at_engage.com)
Date: 03/30/04


Date: 30 Mar 2004 06:05:14 -0800

My program starts by parsing a large amount of data
from a configuration file. This configuration
is (currently) held in a singleton instance.

In other classes in my program I would
very much like to use static fields to hold
unchangeing data, shared amongst instances of
that class.

e.g. I would like, but cannot have

class AClass {
   static int cowCount = Config.getInstance().getNum("cows");
   .
   .
}

If I could defer the running of the static code until after
the Singleton exists, this would work.

I'm having half-formed ideas about classloaders, and
separate jar files, but I just don't know enough.

Is there a standard answer to this (common - I guess)
question?

    BugBear