I need to model associations between two objects that can have attributes, such as a weight and other factors. What is the best way to do this? Do I need to create an object to store the attributes of the association - i.e., AssociationObject which links to the two objects that are associated and stores the relevant attributes?
That is what I normally do...
breaking up N:M relationships also makes fr a more accessible domain-model (IMHO)
Lex van Rooy
The best way to do this is to use a value between the two entities and give a weight to a entry in that entity.
I would say that is the best possible solution you can come up with.
Otherwise you could store the value in the parent entity instead and traverse the associated things by retrieving only the largest weight or smallest, this would be case dependent.