I'm trying to find the best design for the following scenario - an application to store results of dance competitions.
An event contains multiple rounds, each round contains a number of performances (one per dance). Each performance is judged by many judges, who return a scoresheet.
There are two types of rounds, a final round (containing 6 or less dance couples) or a normal round (containing more than 6 dance couples). Each requires slightly different behaviour and data.
In the case of a final round, each scoresheet contains an ordered list of the 6 couples in the final showing which couple the judge placed 1st, 2nd etc. I call these placings "a scoresheet contains 6 placings". A placing contains a couple number, and what place that couple is
In the case of a normal round, each scoresheet contains a non-ordered set of M couples (M < the number of couples entered into the round - exact value determined by the competition organiser). I call these recalls: "a score sheet as M recalls". A recall does not contain a score or a ranking
for example In a final
- 1st place: couple 56
- 2nd place: couple 234
- 3rd place: couple 198
- 4th place: couple 98
- 5th place: couple 3
- 6th place: couple 125
For a normal round The following couples are recalled 54,67,201,104,187,209,8,56,79,35,167,98
My naive-version of this is implemented as
Event - has_one final_round, has_many rounds
final_round - has_many final_performances final_performance - has_many final_scoresheets final_scoresheet - has_many placings
round - has_many perforomances performance has_many scoresheets scoresheet has_many recalls
However I do not like the duplication that this requires, and I have several parallel hierarchies (for round, performance and scoresheet) which is going to be a pain to maintain.