lutaml / lutaml-uml

UML module for LutaML
2 stars 2 forks source link

UML syntax: Feature #20

Open ronaldtse opened 3 years ago

ronaldtse commented 3 years ago

Features

Features

Features

Features

--|-- |In  | The caller passes the parameter value to the behavior |Out | The behavior passes the parameter value to the caller |Inout | The caller first passes the parameter value to the behavior, which returns it to the caller |Return | Similar tu out, except that return explicitly specifies the return values of the behavior

Features-notation

From https://www.linkedin.com/learning/software-design-modeling-with-uml/class-diagrams-classifiers-and-features?autoplay=true&resume=false

Screen Shot 2020-08-05 at 1 11 38 AM Screen Shot 2020-08-05 at 1 09 49 AM

Proposal:

class BankAccount {
  +accountNumber: string[1] {id, readonly}
  -ssn: string[1..5] {unique}

  +deposit(in amount:float): float
  #calcMonthlyAverageBalances(inout monthlyBalances float[12]): void
}
w00lf commented 3 years ago
class BankAccount {
  +accountNumber: string[1] {id, readonly}
  -ssn: string[1..5] {unique}

  +deposit(in amount:float): float
  #calcMonthlyAverageBalances(inout monthlyBalances float[12]): void
}

@ronaldtse Just spotted a problem here. We use # as a comment notation, so we cant use it a visibility modifier, what should we do in that case? Change comment notation or introduce other way to define protected method? We can change comments to use explicit comment keyword:

class Pet {
   comment 'number of legs of a pet'
   attribute number
}

11

ronaldtse commented 3 years ago

I did not realize that # can be a visibility modifier. Can we use something like % or > (latex uses % for comments, idris uses >)?

w00lf commented 3 years ago

I did not realize that # can be a visibility modifier. Can we use something like % or > (latex uses % for comments, idris uses >)?

Lets use % in that case

ronaldtse commented 3 years ago

Awesome, then this is set. @w00lf could you help update the documentation? Thanks!

w00lf commented 3 years ago

Awesome, then this is set. @w00lf could you help update the documentation? Thanks!

Sure, i am updating it as we go