M
mark4asp
Q: Initialising and updating a class with only static members &
database dependency
I have a class with the following members:
public static List<ACIS> ACIS_List;
static AssetClass() { // blah }
public static ACIS Get_ACIS(string sACISCode) { // blah }
public static ACIS Get_ACIS(int iACIS_Id) { // blah }
Furthermore there are another 6 classes like this - each one has a
static List<T> with methods used to search the List<T> to return data.
Classes fall into 2 different types: (a) those with more or less
fixed, unchanging, data and (b) those having data which may change
daily.
Q1. What is the best way to initialise all these classes at once? I
would like to load all these classes with data at once because that
would only need one hit to the database.
Q2. Taking the reply to Q1 above into account, what is the best kind
of constructor to use? static, private, etc.? Should I be using the
constructor to load the class List<T> with data?
Q3. If some of these Lists become out-of-date, can I set up a
dependency which works to update the List<T> with the most recent data
- i.e. something which works like a cache dependency?
database dependency
I have a class with the following members:
public static List<ACIS> ACIS_List;
static AssetClass() { // blah }
public static ACIS Get_ACIS(string sACISCode) { // blah }
public static ACIS Get_ACIS(int iACIS_Id) { // blah }
Furthermore there are another 6 classes like this - each one has a
static List<T> with methods used to search the List<T> to return data.
Classes fall into 2 different types: (a) those with more or less
fixed, unchanging, data and (b) those having data which may change
daily.
Q1. What is the best way to initialise all these classes at once? I
would like to load all these classes with data at once because that
would only need one hit to the database.
Q2. Taking the reply to Q1 above into account, what is the best kind
of constructor to use? static, private, etc.? Should I be using the
constructor to load the class List<T> with data?
Q3. If some of these Lists become out-of-date, can I set up a
dependency which works to update the List<T> with the most recent data
- i.e. something which works like a cache dependency?