Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Who stores totals in their Parent tables?
Message
De
21/05/2009 14:19:27
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
20/05/2009 22:55:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01401186
Message ID:
01401391
Vues:
52
>Am I right that this is a classic bad example of how to manage these reference totals? The values are indeed needed often throughout our system, but I am convinced that this is a bad way to do it.
>
>Now then, before I get too far into reworking how this is handed in my system, would some of you smart folks please tell me how you handle this common issue.

If you decide to keep the totals (which is a legitimate decision - see what Brandon and Hilmar said), there's a good and bad way to do that too. One of the good ways is to centralize the calculation. I.e. have a business object which will do it, and have it instantiated whenever a calculation is needed, and use it and only it to calculate anything. Any code on the side that calculates is bad - it will be forgotten, it will be out of sight, it will be an invitation to disaster.

While centralizing the calculation code, you'll actually gain a better understanding of the scope and the rules of your system, and should be able in time to streamline and simplify the code - thus reducing the maintenance while extending the lifetime expectancy of your nervous system :).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform