用PlantUML画UML类图KafkaProducer

利用PlantUML可以非常方便的画各种UML图,下面是我画的KafkaProducer的类图。


Screen Shot 2020-04-09 at 9.46.43 PM.png

最方便的是这个图是用几行代码表达出来的。

@startuml
!includeurl https://raw.githubusercontent.com/ebbypeter/Archimate-PlantUML/master/Archimate.puml

title Kafka Producer
' KafkaProducer Elements
class KafkaProducer
class ProducerMetadata
class ProducerConfig
class DefaultPartitioner
class RecordAccumulator {
    ConcurrentMap<TopicPartition, Deque<ProducerBatch>> batches
}
class Sender
' RecordAccumulator Elements
class ProducerBatch
class TopicPartition
' Sender Elements
class KafkaClient

' KafkaProducer Relationships
Rel_Serving_Up(KafkaProducer, ProducerMetadata, "")
Rel_Serving_Up(KafkaProducer, ProducerConfig, "")
Rel_Serving_Up(KafkaProducer, DefaultPartitioner, "")
Rel_Serving_Up(KafkaProducer, RecordAccumulator, "")
Rel_Serving_Up(KafkaProducer, Sender, "")
' RecordAccumulator Relationships
Rel_Serving_Up(RecordAccumulator, ProducerBatch, "")
Rel_Serving_Up(RecordAccumulator, TopicPartition, "")
' Sender Relationships
Rel_Serving_Up(Sender, RecordAccumulator, "")
Rel_Serving_Up(Sender, ProducerMetadata, "")
Rel_Serving_Up(Sender, KafkaClient, "")

@enduml

我是用的intellij idea的plantuml插件画的。sublime和vscode都有插件支持。

下次我再画一下KafkaProducer的方法调用序列图sequence uml。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 1、基本认识 UML——Unified modeling language UML (统一建模语言), 是一种用于...
    wangDavid939i阅读 1,233评论 0 3
  • 一、基本概念 UML:统一建模语言(英语:Unified Modeling Language,缩写 UML)是非专...
    地球是猿的阅读 3,132评论 0 6
  • 【IT 工具 UML图】 产品经理的必备技能之一是画UML图,本文就告诉你怎么画标准的类图吧。本文结合网络资料和个...
    Rtia阅读 1,700评论 0 16
  • 原文:https://herbertograca.com/2019/08/12/documenting-softw...
    qinyu阅读 3,679评论 0 2
  • 最近喜欢上博弈论,持续学习更新中
    永不熄灭阅读 197评论 0 0