lutaml / lutaml-uml

UML module for LutaML
2 stars 2 forks source link

UML syntax: Typed elements #14

Closed ronaldtse closed 3 years ago

ronaldtse commented 4 years ago

Typed elements

Screen Shot 2020-08-03 at 9 54 40 PM

Proposal:

class Booking {
  +booker: customer
}

# class MyClass {
#   +TypedElement: Type
# }
w00lf commented 4 years ago

@ronaldtse looks good, but i would also add attribute notation:

class Booking {
  + attribute booker: customer
}
ronaldtse commented 4 years ago

As per #10 I think we need to allow a shorthand. The keyword "attribute" is fine, but allowing a shorthand of omitting it would be good.

w00lf commented 4 years ago

As per #10 I think we need to allow a shorthand. The keyword "attribute" is fine, but allowing a shorthand of omitting it would be good.

Can you please explain the difference between typed element and derived attribute?

ronaldtse commented 4 years ago

"Typed element" is an attribute that accepts only a certain "Type".

Screen Shot 2020-08-06 at 5 39 20 PM

Derived attribute is an attribute that has a value produced/assigned from another place: https://www.uml-diagrams.org/derived-property.html

Screen Shot 2020-08-06 at 5 41 14 PM

They are prefixed with slash /myattribute. The following example is clear.

Screen Shot 2020-08-06 at 5 41 46 PM
w00lf commented 3 years ago

Implemented in repo