Skip to main content

オブジェクト図

(Object Diagram)

サンプル

@startuml
object "myCar" as car
car : brand = "Toyota"
car : model = "Prius"
car : color = "Red"
car : owner = "John"

object "myHouse" as house
house : address = "123 Main St"
house : owner = "John"

car -- house : is owned by
@enduml
PlantUML diagram

全体の設定

タイトル

タイトルを定義できます。

title 新基盤構築計画
PlantUML diagram

ヘッダ

ヘッダを定義できます。

header 新基盤構築計画
PlantUML diagram

フッタ

フッタを定義できます。

footer フッタ
PlantUML diagram

キャプション

キャプションを定義できます。

caption キャプション
PlantUML diagram

すべて組み合わせると...

PlantUML diagram

オブジェクト

オブジェクトを定義できます。

object myCar
PlantUML diagram

オブジェクトのクラス

:の後に続けて記載する事でオブジェクトのクラスを指定できます。

object "myCar: Car"
PlantUML diagram

オブジェクトの別名

asの後に続けて記載する事でオブジェクトの別名を指定できます。
別目は、後でオブジェクトの関係などを定義する際などに使用できます。
見た目上の変化はありません。

object "myCar" as car

オブジェクトのメンバ

オブジェクトのメンバを定義できます。

car : brand = "Toyota"
PlantUML diagram

関連線

関連線を定義できます。

car -- house
PlantUML diagram

位置調整

object1 -u- objectUp
PlantUML diagram

object1 -d- objectDown
PlantUML diagram

object1 -l- objectLeft
PlantUML diagram

object1 -r- objectRight
PlantUML diagram