Hi,
Best to explain this by analogy.....
Imagine a 100 Metre track and field race.
A race contains a number of runners each of which produces a performance.
A runner has a number a performances over a number of races.
Races and runners therefore both contain the collection object Performances. But for each performance within a race context, I need to know the runner ID, not the race ID (contained in Race) and for each performance in a runner object I need to know the race ID, not the runner ID (contained in race)
Now I know that I could create a generic Performance class and inherit it and add the property I need in a further 2 classes. But this seems intuitively wrong.
I'm sure there is a better way of doing this. Can anyone help, please?
Craig
Best to explain this by analogy.....
Imagine a 100 Metre track and field race.
A race contains a number of runners each of which produces a performance.
A runner has a number a performances over a number of races.
Races and runners therefore both contain the collection object Performances. But for each performance within a race context, I need to know the runner ID, not the race ID (contained in Race) and for each performance in a runner object I need to know the race ID, not the runner ID (contained in race)
Now I know that I could create a generic Performance class and inherit it and add the property I need in a further 2 classes. But this seems intuitively wrong.
I'm sure there is a better way of doing this. Can anyone help, please?
Craig