To model one to many relationship, you can use double-quotes "" on each side of the relation.
Example
Human "1" -- "many" BodyParts Human "1" -- "1..*" BodyParts
Above one specifies that one human has many body parts.
oneToMany.txt
@startuml title "Class Composition" class Human class BodyParts Class Brain class Lungs class Liver class Heart class Stomach class Kidney class Bladder class Frontal class Parietal class Temporal class Occipital Human "1" -- "many" BodyParts BodyParts
Above snippet generate below diagram.
Previous Next Home
This post first appeared on Java Tutorial : Blog To Learn Java Programming, please read the originial post: here