facebook twitter hatena line email

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

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(クラス関係性作成)
 
(同じ利用者による、間の2版が非表示)
行32: 行32:
  
 
==クラス図作成==
 
==クラス図作成==
class.txt
+
class.pu
 
<pre>
 
<pre>
 
@startuml
 
@startuml
行50: 行50:
  
 
==クラス関係性作成==
 
==クラス関係性作成==
relation.txt
+
relation.pu
 
<pre>
 
<pre>
 
@startuml
 
@startuml
行66: 行66:
  
 
処理
 
処理
  java -jar /d/src/plantuml.jar  class.txt
+
  java -jar /d/src/plantuml.jar  relation.txt
  
 
参考:https://www.mum-meblog.com/entry/research-detail/plant_uml
 
参考:https://www.mum-meblog.com/entry/research-detail/plant_uml

2023年12月6日 (水) 13:15時点における最新版

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.pu

@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.pu

@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