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

Property strings on class diagrams #3189

Closed
ACMCMC opened this issue Jun 29, 2022 · 1 comment · Fixed by #4534
Closed

Property strings on class diagrams #3189

ACMCMC opened this issue Jun 29, 2022 · 1 comment · Fixed by #4534
Assignees
Labels

Comments

@ACMCMC
Copy link

ACMCMC commented Jun 29, 2022

Is your feature request related to a problem? Please describe.
I am trying to use property strings on class diagrams.

In standard UML, operations (methods) have the following syntax:

[visibility] name [(parameter-list)] [: return-type] [{property-string}]

However, property strings (the last element) are not currently supported by Mermaid.

For instance, the following code is marked as syntactically incorrect:

classDiagram
class MyClass{
      +x(parameter) A
      +y() B {property}
    }

Describe the solution you'd like
It would be great if Mermaid added support for these property strings.

It doesn't need to do it using curly brackets, if that inserts ambiguity in the syntax of the language. For example, using [square brackets] seems like a viable option to me.

Describe alternatives you've considered
"quotation marks" could also work for the implementation of property strings. I think that might be more intuitive.

Other option would be to use a similar approach to labels on relationships.

All in all, there's different possibilities for the implementation, and no clear better choice.

Additional context
The following would an example of how to render a property string:
example-class

For further context, you can read more about property strings on any UML reference textbook.

A good one is: The Unified Modeling Language User Guide; G. Booch, J. Rumbaugh, I.Jacobson; Addison-Wesley; First Edition. (Chapter 9, "operations").
Another good one is: UML Distilled; M. Fowler; Addison-Wesley; Third Edition. (chapter 3, page 44).

@ACMCMC ACMCMC added Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request labels Jun 29, 2022
@ashishjain0512
Copy link
Collaborator

@ACMCMC This sure looks like a nice to have enhancement. We accept this as a valid enhancement feature t and will await a PR regarding this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants