オブジェクト図
(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
@endumlPlantUMLソース
@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全体の設定
タイトル
タイトルを定義できます。
title 新基盤構築計画PlantUMLソース
@startuml
title 新基盤構築計画
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ヘッダ
ヘッダを定義できます。
header 新基盤構築計画PlantUMLソース
@startuml
header 新基盤構築計画
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フッタ
フッタを定義できます。
footer フッタPlantUMLソース
@startuml
footer フッタ
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キャプション
キャプションを定義できます。
caption キャプションPlantUMLソース
@startuml
caption キャプション
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ソース
@startuml
header 新基盤構築計画
title 新基盤構築計画
caption キャプション
footer フッタ
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オブジェクト
オブジェクトを定義できます。
object myCarPlantUMLソース
@startuml
object myCar
@endumlオブジェクトのクラス
:の後に続けて記載する事でオブジェクトのクラスを指定できます。
object "myCar: Car"PlantUMLソース
@startuml
object "myCar: Car"
@endumlオブジェクトの別名
asの後に続けて記載する事でオブジェクトの別名を指定できます。
別目は、後でオブジェクトの関係などを定義する際などに使用できます。
見た目上の変化はありません。
object "myCar" as carオブジェクトのメンバ
オブジェクトのメンバを定義できます。
car : brand = "Toyota"PlantUMLソース
@startuml
object "myCar" as car
car : brand = "Toyota"
@enduml関連線
関連線を定義できます。
car -- housePlantUMLソース
@startuml
object "myCar" as car
object "myHouse" as house
car -- house
@enduml位置調整
上
object1 -u- objectUpPlantUMLソース
@startuml
object "object1"
object "objectUp"
object1 -u- objectUp
@enduml下
object1 -d- objectDownPlantUMLソース
object "object1"
object "objectDown"
object1 -d- objectDown
@enduml左
object1 -l- objectLeftPlantUMLソース
@startuml
object "object1"
object "objectLeft"
object1 -l- objectLeft
@enduml右
object1 -r- objectRightPlantUMLソース
@startuml
object "object1"
object "objectRight"
object1 -r- objectRight
@enduml