If I had a class definition that looked like this:
class A extends class B {
private B b
}
How could I represent this relationship in UML? Also is this a bad design and why?
The extends
keyword in Java stands for a generalization, shown as a hollow triangle in UML.
The association is shown as a solid line. The role name b
is attached towards the B
class with a -
prefix for a private one. And the large dot tells that it's an owned property of A
.
There's basically nothing wrong with that.
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.