From the course: Object-Oriented Programming with Java

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

Drawing with UML

Drawing with UML

- [Instructor] For classes we use square boxes, and for connecting the classes we use different styles of connectors depending on the relationship. This first one is the arrow you use to show inheritance, so this arrow actually means is-A. This diamond-headed arrow connotates a has-A relationship and we use that for composition. There's two styles of composition arrowheads. In the other one the diamond is shaded in, that signifies a tighter relationship, a relationship of ownership, kind of like an engine in a car. It wouldn't really make sense because the engine doesn't really exist outside of the car or have any useful purpose. Let's look at a class diagram that shows the relationships between humans, werewolves, and vampires. And then I'm going to connect them with the open-ended arrow that shows that they extend. So I'm imagining humans do things like run or sit, and then werewolves might have extra talents like morph.…

Contents