Can two classes each have an association with a third class?
For example: Game object has position, and character also has position, shown below
I understand association class can contain another class
Classes can be associated with as many other classes as necessary.
Your diagram correctly represents the fact that both a GameObject
and a Character
have a Position
. You should however either remove the arrow, or make sure that the arrow head is open (if you want to say that the association is navigablle, i.e. promise that both classes can find their position efficiently at run-time).
The only case where there are resistriction is when you use composite aggregation, but it is not the case here.
Important remark: the term "association class" refers to a different concept, and not simply that a class is used in an association. The same association class cannot be used for several associations because the association class is an association. But you don't have this problem here. If you want to know more about this tricky case, see this other question