Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

PlantUML: Draw one to many relationship in class diagram

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

Share the post

PlantUML: Draw one to many relationship in class diagram

×

Subscribe to Java Tutorial : Blog To Learn Java Programming

Get updates delivered right to your inbox!

Thank you for your subscription

×