其他分享
首页 > 其他分享> > 不错的画类图工具-PlantUML

不错的画类图工具-PlantUML

作者:互联网

今天在学习设计模式时发现一个不错的画类图工具-PlantUML, 传送门,它除了可以画UML,还支持其它,请查看

以下是我使用PlantUML语法的例子:

@startuml
abstract class Drink{
 + String description
 - float price
 float price()
}

class Coffee{
  + float cost()
}

class Decorator{
 - Drink obj
 + Decorator(Drink obj)
 + float cost()
 + String getDesc()
}

Drink <|-- Coffee
Drink <|-- Decorator
Drink o-- Decorator

class Espresso{
 + Espresso()
}

class AmericanCoffee{
 + AmericanCoffee()
}

Coffee <|-- Espresso
Coffee <|-- AmericanCoffee

class Chocolate{
 + Chocolate(Drink obj)
}

class Milk{
 + Milk(Drink obj)
}

Decorator <|-- Chocolate
Decorator <|-- Milk

Chocolate ..> Drink
Milk ..> Drink
@enduml

生成的效果:

 

大家可以尝试下,本人觉得很快速与高效。

标签:PlantUML,画类,float,class,cost,不错,Drink
来源: https://www.cnblogs.com/johnnyzhao/p/14395553.html