Jean
Jean

Reputation: 731

UML Inheritance and associations?

If i have one superclass in a UML diagram, with 3 subclasses, can two of the subclasses have an association relationship between them? I wasnt sure if this was allowed. Thanks

Upvotes: 1

Views: 332

Answers (2)

nakhli
nakhli

Reputation: 4059

It is allowed. You can have association between subclasses or even between subclasses and the base class.

Upvotes: 1

Hari Subramaniam
Hari Subramaniam

Reputation: 1876

Now my questions iw hy would you want to do that?An explanation of your problem domain would help?Answer is it depends. When you say that there is an association between two types who are in turn specialized versions of a another type, i would infer that those types are there for a specific reason. Why should derived type A know about the public contracts of Derived type B and vice versa? But then again need an explantion of your problem domain to conclude i believe.

Upvotes: 0

Related Questions