Sunday, 9 July 2023

PlantUML: Define interface in a class diagram

‘interface’ keyword define an interface.

 

Example

interface List{
	+ int size()
	+ void clear()
}

 

Find the below working application.

 

interface.txt

@startuml

interface List{
	+ int size()
	+ void clear()
}

abstract class AbstractList{
	# int modCount	
}
class ArrayList
class LinkedList
class Serializable

enum TimeUnit {
	DAYS
	HOURS
	MINUTES
}

List <|.. AbstractList 
AbstractList <|-- ArrayList
AbstractList <|-- LinkedList
Serializable <|.. ArrayList
Serializable <|.. LinkedList

@enduml

 

Above snippet generate below diagram.

 


 

  

Previous                                                    Next                                                    Home

No comments:

Post a Comment