Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Where to keep global values ?
Message
De
25/04/2000 19:23:56
 
 
À
24/04/2000 21:34:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00362947
Message ID:
00363382
Vues:
32
Thanks Mike,

>>1) There are values related to the calendar e.g. Days of week or names of months in spanish. You may consider these to be "permanent" values.
>
>#Define these as constants.

What I need is more of an array so that I can say:
? gaDiaSemana[DOW(DATE()]
I think I'll go with oApp.aDiaSemana[]


>>2) Values established by law for all clients. I keep many of these in a table, but I find it better to load them up to memory and work from there since table isn't always in right record. Perhaps an object which represents that table?
>
>This would be the middle tier, Business Rules, create an object wiht methods that will verify most of the data you want to submit.
>

OK

>>4) Values that have to do with the company (user may have several). oCompany?>I normally leave these as table records. Or, instead of saving the fields as properties, create an object with a method that will return a value from the correct record and field.

Some are best kept as in table, such as address, etc, but I have a parameter file where many user options are stored. Some are used infrequently, so I get them as I need them, but others are used more regularly, and I think it's best not to look into the parameter file frequently. I think it's best if they don't go in oApp, since they are not totally global.


FWIW, I'll describe the parameter setup I use which although similar to MaxFrame's, I think is better :).

PARAMETER TABLES:
1) An internal (in the project) file. (xxParInt).

2) An external file (xxPar). It resides with company data. Since user may have more than one company I am considering having a site parameter file which would reside in application directory, which has intermediate priority.

3) Can override an internal parameter with the external one.

4) File structure, same for all files.
cGroup C(40)
cParameter C(40)
cType C(1) - C/L/N/P/A (Char,Logic,Numeric,Program,Array)
cValue - If cType='P', contains object code.
cDescription - If cType='P', contains source code.

INTERFACE ROUTINES.
GetParam(tcGroup,tcParameter,tuDefault[,tnArrayRow])
GetParamList(tcCondition,taArray,tnMaxRowLength)
PutParam(tcGroup,tcParameter,tcType,tuValue)

Alex
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform