I have Class A calling an abstract class B and class B returns an object. How can I represent this in UML? Also, is there a resource that shows source code and then the equivalent UML diagrams? This would help me a lot! I have a hard time understanding the definitions of association, aggregation, etc… without actual code as an example.
For example,
Class A {
constructor {
B = B.hello();
}
}
Abstract Class B {
public static hello() {
return new C();
}
}
Class C extends B {
}
You can show this using two diagrams:
Ais related toB, andCextendsB. Nothing else.A.constructor, then fromA.constructorshow a call toB.hello, which then creates a newC.The specific UML syntax for these diagrams can be found here.
Regarding code and UML, it is problematic since:
I don’t know of a site that does this, but it could be an interesting project…