「Android/開発環境/AndroidStudio/UMLクラス図」の版間の差分
提供: 初心者エンジニアの簡易メモ
(→graphvizインストール準備) |
(→クラス関係性作成) |
||
| (同じ利用者による、間の13版が非表示) | |||
| 行3: | 行3: | ||
brew install --build-from-source python@3.9 | brew install --build-from-source python@3.9 | ||
| − | == | + | ==plantuml.jarのインストール== |
| − | + | https://sourceforge.net/projects/plantuml/files/plantuml.jar/download | |
| − | == | + | ==graphvizインストール== |
brew install graphviz | brew install graphviz | ||
# 確認 | # 確認 | ||
$ which dot | $ which dot | ||
/usr/local/bin/dot | /usr/local/bin/dot | ||
| + | |||
| + | ==graphviz実行== | ||
| + | java -jar /d/src/plantuml.jar -testdot | ||
| + | |||
| + | ==シーケンス図作成== | ||
| + | sequence.txt | ||
| + | <pre> | ||
| + | @startuml | ||
| + | Alice -> Bob: Authentication Request | ||
| + | Bob --> Alice: Authentication Response | ||
| + | Alice -> Bob: Another authentication Request | ||
| + | Alice <-- Bob: another authentication Response | ||
| + | @enduml | ||
| + | </pre> | ||
| + | |||
| + | 処理 | ||
| + | java -jar /d/src/plantuml.jar sequence.txt | ||
| + | |||
| + | 参考:https://codechacha.com/ja/how-to-use-plantuml/ | ||
| + | |||
| + | ==クラス図作成== | ||
| + | class.pu | ||
| + | <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.pu | ||
| + | <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 | ||
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
