>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 :).