facebook twitter hatena line email

「Android/開発環境/AndroidStudio/UMLクラス図」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(シーケンス図作成)
(クラス関係性作成)
(同じ利用者による、間の5版が非表示)
行31: 行31:
 
参考:https://codechacha.com/ja/how-to-use-plantuml/
 
参考:https://codechacha.com/ja/how-to-use-plantuml/
  
==unityで自動クラス図生成==
+
==クラス図作成==
https://github.com/pierre3/PlantUmlClassDiagramGenerator
+
class.txt
 +
<pre>
 +
@startuml
 +
class Enemy {
 +
    + string type
 +
    ~ string name
 +
    # void SayHello()
 +
    - void Attack()
 +
}
 +
@enduml
 +
</pre>
 +
 
 +
処理
 +
java -jar /d/src/plantuml.jar  class.txt
 +
 
 +
参考:https://www.mum-meblog.com/entry/research-detail/plant_uml
 +
 
 +
==クラス関係性作成==
 +
relation.txt
 +
<pre>
 +
@startuml
 +
Cat --|> Animal : 継承
 +
Wheel "4" --* "1" Car : コンポジション
 +
Employee "many" --o  "1" Company : 集約
 +
Car -- VehicleInspection : 関連
 +
UseCase ..|> IUseCase: 実現
 +
Runner ..> Marathon : 依存
 +
 
 +
interface IUseCase
 +
abstract class Human
 +
@enduml
 +
</pre>
 +
 
 +
処理
 +
java -jar /d/src/plantuml.jar  relation.txt
 +
 
 +
参考:https://www.mum-meblog.com/entry/research-detail/plant_uml

2022年1月14日 (金) 14:09時点における版

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