design question - initialising static fields via a singleton?
From: bugbear (pwomack_at_engage.com)
Date: 03/30/04
- Next message: Dario: "Re: Garbage collection"
- Previous message: rowland: "Do Sun skill certifications help land jobs?"
- Next in thread: Peter Kirk: "Re: design question - initialising static fields via a singleton?"
- Reply: Peter Kirk: "Re: design question - initialising static fields via a singleton?"
- Reply: Chris Uppal: "Re: design question - initialising static fields via a singleton?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Dario: "Re: Garbage collection"
- Previous message: rowland: "Do Sun skill certifications help land jobs?"
- Next in thread: Peter Kirk: "Re: design question - initialising static fields via a singleton?"
- Reply: Peter Kirk: "Re: design question - initialising static fields via a singleton?"
- Reply: Chris Uppal: "Re: design question - initialising static fields via a singleton?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]