Quote:
|
Originally Posted by Riorin
.....My question is HOW DO YOU MODEL THIS and should you try to foresee every possibility in table design OR SHOULD YOU SIMPLY PUT THE RULES FOR STANDINGS CALCULATIONS IN YOUR CODE?....
|
in an ideal world I think you should store all this meta data within the db. however it could get quite complex. I have seen applicatrions which had a effectively a rules tables which governed how a particular invoice was calculated (what type of items achieved what type of discount, or what type of order threshold, or what type of end of year rebate was permitted). it could be fiendishly complex to design, but once defined applying the sort of logic you want to apply to your sports / teams / leagues should be relatively easy to use. However it may not be appropriate when you are just starting out on the db design world
if you put it entirely into application code you are going to cause problems if / as / or when the format changes. as you have no direct control over the way teams are promoted or what competitions they compete in the last thing id want to do in your place is to have to write new application code to handle it. Admittedly the OOP (object orientated paradigam) should be a way round this problem.