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.

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

Diagrama de Objetos

Object Diagram

Definición de objetos

Puedes definir instancias de objetos usando la palabra reservada object.

@startuml
object firstObject
object "My Second Object" as o2
@enduml

Definition of objects

You define instance of objects using the object keywords.

@startuml
object firstObject
object "My Second Object" as o2
@enduml

Relaciones entre objetos

Las relaciones entre objetos son definidas usando los siguientes símbolos:

Type Symbol Image
Extension <|--
Composition *--
Aggregation o--

Es posible reemplazar -- con .. para obtener una línea de puntos.

Sabiendo estas reglas, es posible dibujar los siguientes diagramas.

Es posible agregar una etiqueta sobre una relación usando :, seguido del texto de la etiqueta.

Para la cardinalidad puedes usar doble comillas "" en cada lado de la relación.

@startuml
object Object01
object Object02
object Object03
object Object04
object Object05
object Object06
object Object07
object Object08

Object01 <|-- Object02
Object03 *-- Object04
Object05 o-- "4" Object06
Object07 .. Object08 : some labels
@enduml

Relations between objects

Relations between objects are defined using the following symbols :

Type Symbol Image
Extension <|--
Composition *--
Aggregation o--

It is possible to replace -- by .. to have a dotted line.

Knowing those rules, it is possible to draw the following drawings.

It is possible a add a label on the relation, using : followed by the text of the label.

For cardinality, you can use double-quotes "" on each side of the relation.

@startuml
object Object01
object Object02
object Object03
object Object04
object Object05
object Object06
object Object07
object Object08

Object01 <|-- Object02
Object03 *-- Object04
Object05 o-- "4" Object06
Object07 .. Object08 : some labels
@enduml

Agregando campos

Para declarar campos, puedes usar el símbolo : seguido del nombre del campo.

@startuml

object user

user : name = "Dummy"
user : id = 123

@enduml

También es posible declarar entre llaves {} todos los campos.

@startuml

object user {
  name = "Dummy"
  id = 123
}

@enduml

Adding fields

To declare fields, you can use the symbol : followed by the field's name.

@startuml

object user

user : name = "Dummy"
user : id = 123

@enduml

It is also possible to group all fields between brackets {}.

@startuml

object user {
  name = "Dummy"
  id = 123
}

@enduml

Características comunes en diagramas de clases

Common features with class diagrams


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