Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put class accessors together with methods #117

Open
lgberro opened this issue Oct 1, 2023 · 0 comments
Open

Put class accessors together with methods #117

lgberro opened this issue Oct 1, 2023 · 0 comments

Comments

@lgberro
Copy link

lgberro commented Oct 1, 2023

Wouldn't it be better to have class accessors together with it's methods? That would make diagram easier to read.

class Accessors {
  _foo: string
  _bar: string

  get bar() {
    return this._bar
  }

  set bar(value) {
    this._bar = value
  }

  foo() {
    this._foo = 'foo'
  }
}

current output

Screenshot 2023-10-01 at 14 33 50
@startuml
class Accessors {
    +_foo: string
    +_bar: string
    +bar: string
    +bar: string
    +foo(): void
}
@enduml

suggestion

Screenshot 2023-10-01 at 14 32 12
@startuml
class Accessors {
    +_foo: string
    +_bar: string
    +{method} get bar: string
    +{method} set bar: string
    +foo(): void
}
@enduml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant