lutaml / lutaml-uml

UML module for LutaML
2 stars 2 forks source link

UML syntax: aggregation and composition #26

Open ronaldtse opened 4 years ago

ronaldtse commented 4 years ago
Screen Shot 2020-08-05 at 2 13 35 AM

Proposal:

class Whole {
  aggregation_of Part[0..1] "consists of"
}

class Part {
}
Screen Shot 2020-08-05 at 2 14 09 AM

Proposal:

class Whole {
  aggregation_of Part
  composition_of ExistentiallyDependentPart
}

class Part
class ExistentiallyDependentPart
Screen Shot 2020-08-05 at 2 14 44 AM

Proposal:

class Car {
  aggregation_of Engine[0..1][1] "has"
}
class Boat {
  aggregation_of Engine[0..1][1] "has"
}
class Engine {
  of_aggregation Car
  of_aggregation Boat
}
Screen Shot 2020-08-05 at 2 15 07 AM

Proposal:

class Car {
  composition_of Engine[0..1][1] "has"
}
class Boat {
  composition_of Engine[0..1][1] "has"
}
class Engine {
  of_aggregation Car
  of_aggregation Boat
}

Composition

w00lf commented 4 years ago

@ronaldtse do we need the direction arrow of association label(has in the case below)?

class Car {
  composition_of Engine[0..1][1] "has"
}
class Boat {
  composition_of Engine[0..1][1] "has"
}
ronaldtse commented 4 years ago

@ronaldtse do we need the direction arrow of association label(has in the case below)?

From UML spec:

Screen Shot 2020-08-11 at 11 18 18 AM

This triangle indicates the "association name:

Screen Shot 2020-08-11 at 11 19 12 AM Screen Shot 2020-08-11 at 11 19 18 AM

The direction of this association name/label follows the direction of the arrow.

So we don't need to define it the direction of this solid triangle.