Multilingual Wiki Documentation

You are currently using syntax.
In an attempt to improve PlantUML documentation...
Please do not use this website for your own diagrams.
You can click here and use the online server here for your own documentation.

Wiki Toc    Recent changes    View page history    Add new chapter    Reorder page    Raw


Komponentendiagramm

Let's have few examples : Let's have few examples.
WARNING
 This translation need to be updated. 
WARNING

Component Diagram

Let's have few examples.

Komponenten

Komponenten werden mittels eckiger Klammern definiert.

Alternativ kann das Schlüsselwort component verwendet werden, um eine Komponente zu definieren. Mittels Schlüsselwort as lassen sich Aliase definieren. Aliase können verwendet werden, wenn Beziehungen definiert werden.

@startuml

[First component]
[Another component] as Comp2
component Comp3
component [Last\ncomponent] as Comp4

@enduml

Components

Components must be bracketed.

You can also use the component keyword to define a component. And you can define an alias, using the as keyword. This alias will be used later, when defining relations.

@startuml

[First component]
[Another component] as Comp2
component Comp3
component [Last\ncomponent] as Comp4

@enduml

Schnittstellen

Schnittstellen werden mit zwei Runden Klammern () definiert.

Alternativ kann das Schlüsselwort interface verwendet werden, um Schnittstellen zu definieren. Mittels Schlüsselwort as lassen sich Aliase definieren. Aliase können verwendet werden, wenn Beziehungen definiert werden.

Die Deklaration von Schnittstellen ist optional.

@startuml

() "First Interface"
() "Another interface" as Interf2
interface Interf3
interface "Last\ninterface" as Interf4

@enduml

Interfaces

Interface can be defined using the () symbol (because this looks like a circle).

You can also use the interface keyword to define an interface. And you can define an alias, using the as keyword. This alias will be used latter, when defining relations.

We will see latter that interface definition is optional.

@startuml

() "First Interface"
() "Another interface" as Interf2
interface Interf3
interface "Last\ninterface" as Interf4

[component]
footer //Adding "component" to force diagram to be a **component diagram**//
@enduml

Beispiel

Verbindungen zwischen Elementen können mit folgenden Symbolen erstellt werden: .. (gestrichelte Linie), -- (ausgezogene Linie), and --> (Pfeile).

@startuml

DataAccess - [First Component]
[First Component] ..> HTTP : use

@enduml

Basic example

Links between elements are made using combinations of dotted line (..), straight line (--), and arrows (-->) symbols.

@startuml

DataAccess - [First Component]
[First Component] ..> HTTP : use

@enduml

Notizen

Schlüsselwörter: note left of , note right of , note top of , note bottom of Diese Schlüsselwörter können eingesetzt werden, um Notizen für ein einzelnes Objekt zu erstellen.

Eine Notiz kann mit note definiert werden. Danach kann sie mittels .. mit anderen Objekten verbunden werden.

@startuml

interface "Data Access" as DA

DA - [First Component]
[First Component] ..> HTTP : use

note left of HTTP : Web Service only

note right of [First Component]
  A note can also
  be on several lines
end note

@enduml

Using notes

You can use the note left of , note right of , note top of , note bottom of keywords to define notes related to a single object.

A note can be also define alone with the note keywords, then linked to other objects using the .. symbol.

@startuml

interface "Data Access" as DA

DA - [First Component]
[First Component] ..> HTTP : use

note left of HTTP : Web Service only

note right of [First Component]
  A note can also
  be on several lines
end note

@enduml

Gruppierende Komponenten

Mit package lassen sich Komponenten und Schnittstellen gruppieren.
  • package
  • node
  • folder
  • frame
  • cloud
  • database

@startuml

package "Some Group" {
  HTTP - [First Component]
  [Another Component]
}

node "Other Groups" {
  FTP - [Second Component]
  [First Component] --> FTP
}

cloud {
  [Example 1]
}


database "MySql" {
  folder "This is my folder" {
    [Folder 3]
  }
  frame "Foo" {
    [Frame 4]
  }
}


[Another Component] --> [Example 1]
[Example 1] --> [Folder 3]
[Folder 3] --> [Frame 4]

@enduml

Grouping Components

You can use several keywords to group components and interfaces together:
  • package
  • node
  • folder
  • frame
  • cloud
  • database

@startuml

package "Some Group" {
  HTTP - [First Component]
  [Another Component]
}

node "Other Groups" {
  FTP - [Second Component]
  [First Component] --> FTP
}

cloud {
  [Example 1]
}


database "MySql" {
  folder "This is my folder" {
    [Folder 3]
  }
  frame "Foo" {
    [Frame 4]
  }
}


[Another Component] --> [Example 1]
[Example 1] --> [Folder 3]
[Folder 3] --> [Frame 4]

@enduml

Ändern der Pfeilrichtung

Verbindungen werden mit zwei Minus-Zeichen -- definiert und sind vertikal orientiert. Um eine horizontale Orientierung zu erhalten, kann die Verbindung mit nur einem Minus-Zeichen (oder Punkt) definiert werden:

@startuml
[Component] --> Interface1
[Component] -> Interface2
@enduml

Die Pfeilsymbole können umgedreht werden, um die Pfeilrichtung zu ändern:

@startuml
Interface1 <-- [Component]
Interface2 <- [Component]
@enduml

Die Pfeilrichtung lässt sich auch mit den Schlüsselwörtern left, right, up und down ändern. Diese Schlüsselwörter werden innerhalb des Pfeil-Symbols eingesetzt:

@startuml
[Component] -left-> left
[Component] -right-> right
[Component] -up-> up
[Component] -down-> down
@enduml

Die Pfeillänge kann verkürzt werden, wenn bei der Deklaration der Pfeilrichtung nur der Anfangsbuchstabe (oder ersten zwei Anfangsbuchstaben) verwendet werden: Beispielsweise -d- oder -do- statt -down-.

Diese Funktionalität ist jedoch mit Bedacht einzusetzen, da GraphViz normalerweise gute Resultate ohne manuelle Eingriffe erzielt.

Changing arrows direction

By default, links between classes have two dashes -- and are vertically oriented. It is possible to use horizontal link by putting a single dash (or dot) like this:

@startuml
[Component] --> Interface1
[Component] -> Interface2
@enduml

You can also change directions by reversing the link:

@startuml
Interface1 <-- [Component]
Interface2 <- [Component]
@enduml

It is also possible to change arrow direction by adding left, right, up or down keywords inside the arrow:

@startuml
[Component] -left-> left
[Component] -right-> right
[Component] -up-> up
[Component] -down-> down
@enduml

You can shorten the arrow by using only the first character of the direction (for example, -d- instead of -down-) or the two first characters (-do-).

Please note that you should not abuse this functionality : Graphviz gives usually good results without tweaking.

And with the left to right direction parameter:

@startuml
left to right direction
[Component] -left-> left
[Component] -right-> right
[Component] -up-> up
[Component] -down-> down
@enduml

Use UML2 notation

By default (from v1.2020.13-14), UML2 notation is used.

@startuml

interface "Data Access" as DA

DA - [First Component]
[First Component] ..> HTTP : use

@enduml

UML1-Notation verwenden

Der skinparam componentStyle uml1 Befehl wird werwendet, um in die UML1 Notation umzuschalten.

@startuml
skinparam componentStyle uml1

interface "Data Access" as DA

DA - [First Component]
[First Component] ..> HTTP : use

@enduml

Use UML1 notation

The skinparam componentStyle uml1 command is used to switch to UML1 notation.

@startuml
skinparam componentStyle uml1

interface "Data Access" as DA

DA - [First Component]
[First Component] ..> HTTP : use

@enduml

Use rectangle notation (remove UML notation)

The skinparam componentStyle rectangle command is used to switch to rectangle notation (without any UML notation).

@startuml
skinparam componentStyle rectangle

interface "Data Access" as DA

DA - [First Component]
[First Component] ..> HTTP : use

@enduml

Mehrzeilige Beschreibung

Es ist möglich mehrzeilige Beschreibungen zu erstellen mithilfe von eckigen Klammern

@startuml
component comp1 [
This component
has a long comment
on several lines
]
@enduml

Long description

It is possible to put description on several lines using square brackets.

@startuml
component comp1 [
This component
has a long comment
on several lines
]
@enduml

Individuelle Farben

Eine Farbe kann nach der Komponenten Definition angeben werden.

@startuml
component  [Web Server] #Yellow
@enduml

Individual colors

You can specify a color after component definition.

@startuml
component  [Web Server] #Yellow
@enduml

Verwendung von Sprites in Stereotypen

Sie können Sprites innerhalb von stereotypen Komponenten verwenden.

@startuml
sprite $businessProcess [16x16/16] {
FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF
FFFFFFFFFF0FFFFF
FFFFFFFFFF00FFFF
FF00000000000FFF
FF000000000000FF
FF00000000000FFF
FFFFFFFFFF00FFFF
FFFFFFFFFF0FFFFF
FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF
}


rectangle " End to End\nbusiness process" <<$businessProcess>> {
 rectangle "inner process 1" <<$businessProcess>> as src
 rectangle "inner process 2" <<$businessProcess>> as tgt
 src -> tgt
}
@enduml

Using Sprite in Stereotype

You can use sprites within stereotype components.

@startuml
sprite $businessProcess [16x16/16] {
FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF
FFFFFFFFFF0FFFFF
FFFFFFFFFF00FFFF
FF00000000000FFF
FF000000000000FF
FF00000000000FFF
FFFFFFFFFF00FFFF
FFFFFFFFFF0FFFFF
FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF
}


rectangle " End to End\nbusiness process" <<$businessProcess>> {
 rectangle "inner process 1" <<$businessProcess>> as src
 rectangle "inner process 2" <<$businessProcess>> as tgt
 src -> tgt
}
@enduml

Der Skinparam Befehl

Mit dem skinparam Befehl kann die Farbe und die Schriftart der Zeichnung verändert werden.

Sie können den Befehl auf die folgenden Arten verwenden:
  • Wie alle ander Befehle In einer Diagrammdefinition,
  • in einer Include-Datei,
  • In einer Konfigurationsdatei, die durch die Kommandozeile oder den ANT-Task übergeben wird.

Es können unterschiedliche Farben und Schriftarten für Komponenten und Schnittstellen verwendet werden.

@startuml

skinparam interface {
  backgroundColor RosyBrown
  borderColor orange
}

skinparam component {
  FontSize 13
  BackgroundColor<<Apache>> Red
  BorderColor<<Apache>> #FF6655
  FontName Courier
  BorderColor black
  BackgroundColor gold
  ArrowFontName Impact
  ArrowColor #FF6655
  ArrowFontColor #777777
}

() "Data Access" as DA

DA - [First Component]
[First Component] ..> () HTTP : use
HTTP - [Web Server] << Apache >>

@enduml

@startuml
[AA] <<static lib>>
[BB] <<shared lib>>
[CC] <<static lib>>

node node1
node node2 <<shared node>>
database Production

skinparam component {
    backgroundColor<<static lib>> DarkKhaki
    backgroundColor<<shared lib>> Green
}

skinparam node {
borderColor Green
backgroundColor Yellow
backgroundColor<<shared node>> Magenta
}
skinparam databaseBackgroundColor Aqua

@enduml

WARNING
 This translation need to be updated. 
WARNING

Skinparam

You can use the skinparam command to change colors and fonts for the drawing.

You can use this command :

You can define specific color and fonts for stereotyped components and interfaces.

@startuml

skinparam interface {
  backgroundColor RosyBrown
  borderColor orange
}

skinparam component {
  FontSize 13
  BackgroundColor<<Apache>> Red
  BorderColor<<Apache>> #FF6655
  FontName Courier
  BorderColor black
  BackgroundColor gold
  ArrowFontName Impact
  ArrowColor #FF6655
  ArrowFontColor #777777
}

() "Data Access" as DA

DA - [First Component]
[First Component] ..> () HTTP : use
HTTP - [Web Server] << Apache >>

@enduml

@startuml
[AA] <<static lib>>
[BB] <<shared lib>>
[CC] <<static lib>>

node node1
node node2 <<shared node>>
database Production

skinparam component {
    backgroundColor<<static lib>> DarkKhaki
    backgroundColor<<shared lib>> Green
}

skinparam node {
borderColor Green
backgroundColor Yellow
backgroundColor<<shared node>> Magenta
}
skinparam databaseBackgroundColor Aqua

@enduml

Specific SkinParameter

componentStyle

  • By default (or with skinparam componentStyle uml2), you have an icon for component

@startuml
skinparam BackgroundColor transparent
skinparam componentStyle uml2
component A {
   component "A.1" {
}
   component A.44 {
      [A4.1]
}
   component "A.2"
   [A.3]
   component A.5 [
A.5] 
   component A.6 [
]
}
[a]->[b]
@enduml

  • If you want to suppress it, and to have only the rectangle, you can use skinparam componentStyle rectangle

@startuml
skinparam BackgroundColor transparent
skinparam componentStyle rectangle
component A {
   component "A.1" {
}
   component A.44 {
      [A4.1]
}
   component "A.2"
   [A.3]
   component A.5 [
A.5] 
   component A.6 [
]
}
[a]->[b]
@enduml

[Ref. 10798]


Please report any bugs to plantuml@gmail.com or here.
This website is still in beta testing.