facebook twitter hatena line email

Android/開発環境/AndroidStudio/UMLクラス図

提供: 初心者エンジニアの簡易メモ
2022年1月14日 (金) 14:09時点におけるAdmin (トーク | 投稿記録)による版 (クラス関係性作成)

移動: 案内検索

graphvizインストール準備

xcode-select --install
brew install --build-from-source python@3.9

plantuml.jarのインストール

https://sourceforge.net/projects/plantuml/files/plantuml.jar/download

graphvizインストール

brew install graphviz
# 確認
$ which dot
/usr/local/bin/dot

graphviz実行

java -jar /d/src/plantuml.jar  -testdot

シーケンス図作成

sequence.txt

@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
Alice -> Bob: Another authentication Request
Alice <-- Bob: another authentication Response
@enduml

処理

java -jar /d/src/plantuml.jar  sequence.txt

参考:https://codechacha.com/ja/how-to-use-plantuml/

クラス図作成

class.txt

@startuml
class Enemy {
    + string type
    ~ string name
    # void SayHello()
    - void Attack()
}
@enduml

処理

java -jar /d/src/plantuml.jar  class.txt

参考:https://www.mum-meblog.com/entry/research-detail/plant_uml

クラス関係性作成

relation.txt

@startuml
Cat --|> Animal : 継承
Wheel "4" --* "1" Car : コンポジション
Employee "many" --o  "1" Company : 集約
Car -- VehicleInspection : 関連
UseCase ..|> IUseCase: 実現
Runner ..> Marathon : 依存

interface IUseCase
abstract class Human
@enduml

処理

java -jar /d/src/plantuml.jar  relation.txt

参考:https://www.mum-meblog.com/entry/research-detail/plant_uml