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:
A
is related to B
, and C
extends B
. Nothing else. A.constructor
, then from A.constructor
show a call to B.hello
, which then creates a new C
. 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...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.