Reputation: 127
I have a Class A which is the super class of the class B (that is public class B extends A
). Now I have a another class C, Class A is a instance variable in class C and class B is being downcasted from Class A and being assign to a local variable in class C. How should I represent this relationship in a uml class diagram?
Upvotes: 1
Views: 1123
Reputation: 73456
The class-diagram is straightforward:
Tha association of C with A is structural, since there is an instance variable of that type.
The fact that an operation of C performs a downcast from the instance variable to B in a local variable, does not change the class diagram: the class diagram is about the structure, and not about what may happen temporary during the execution of the one or the other methods.
Upvotes: 1