ER図

インフォメーションエンジニアリングの表記法をベースにしています。

すでに存在しているClass Diagramの拡張になります。

拡張内容:
  • インフォメーションエンジニアリング用の関係線の追加
  • entity を、クラス図の classと読み替え
  • 必須属性を表すものとして、* の表示修飾子を追加

また、クラス図と同じ文法です。クラス図の機能は全て使うことができます。

インフォメーションエンジニアリングの関係線

Type 記号
0か1 |o--
1のみ ||--
0以上 }o--
1以上 }|--

例:

🎉 Copied!

@startuml
Entity01 }|..|| Entity02
Entity03 }o..o| Entity04
Entity05 ||--o{ Entity06
Entity07 |o--|| Entity08
@enduml

エンティティ

🎉 Copied!

@startuml
entity Entity01 {
  * identifying_attribute
  --
  * mandatory_attribute
  optional_attribute
}
@enduml

もう一度いいますが、普通のクラス図の文法です。 (classの代わりにentityを使うのはさておいて)。クラス図でできることは、ER図でもできます。

* 表示修飾子は必須属性を表します。 空白を1文字後ろに入れることで、強調と解釈されることを防ぐと良いでしょう:

🎉 Copied!

@startuml
entity Entity01 {
   optional attribute
   **optional bold attribute**
   * **mandatory bold attribute**
}
@enduml

完全な例

🎉 Copied!

@startuml

' hide the spot
hide circle

' avoid problems with angled crows feet
skinparam linetype ortho

entity "Entity01" as e01 {
  *e1_id : number <<generated>>
  --
  *name : text
  description : text
}

entity "Entity02" as e02 {
  *e2_id : number <<generated>>
  --
  *e1_id : number <<FK>>
  other_details : text
}

entity "Entity03" as e03 {
  *e3_id : number <<generated>>
  --
  e1_id : number <<FK>>
  other_details : text
}

e01 ||..o{ e02
e01 |o..o{ e03

@enduml

現状では、エンティティに角度付きで関係線を引こうとすると、見た目がよく有りません。(訳者注:45度でつながってしまいます)

linetype ortho skinparamを使うことで回避できます。

WARNING
 This translation need to be updated. 
WARNING


Privacy Policy      Advertise