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.

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With