Mermaid: Add `package` to class diagram

Created on 6 Nov 2019  路  17Comments  路  Source: mermaid-js/mermaid

Is your feature request related to a problem? Please describe.

Hello! 袠on-native English speaker warning

I'm relative frequently drawing class diagrams. For now I'm using MagicDraw but I would like to try text-to-scheme solution.

I like your syntax for class diagrams and I would be very happy to use it for my work but I frequently using packages in my schemes. Like class A goes to package X and associated with class B that laying in package Y.

Describe the solution you'd like

I would like to have a package extension for current syntax like:

package Sales {
  class Product {
    +int id
  }
  Product o-- Employees.Manager

package Employees {
  class Manager {
    +int id
  }
}

Describe alternatives you've considered
Do not see any

Additional context
None

Development Class Approved Enhancement

Most helpful comment

I would like to take this on, if no one is opposed...

All 17 comments

Perhaps namespace instead or package?

Well, I just sticked to MagicDraw and Java terms. Its absolutely okay if this thing will be called "namespace"

How does this look in MagicDraw? Could you provide a screenshot of the resulting diagram?

There is two packages - "小锌械褑懈邪谢懈褋褌" ("Specialist") 懈 "携写褉芯" (Kernel). They are modules in my app.

image

Cool, that might be a slightly bigger task, if someone is up to grab it. Should packages be nestable?

As for my task it's not required, because I use them as modules. Modules in my applications structure shouldn't be nested. However I believe that somebody would be happy with nested packages.

So, answering your question - I think that it depends on how hard it will be to implement nested modules. If it creates significant technical complexity then don't do it :)

Desperately need this feature 馃槀

I would like to take this on, if no one is opposed...

I would like to take this on, if no one is opposed...

Great. Love to see how active you are!

Would it be possible to re-open this issue? I think this is highly important and required feature when modeling real life/large information models. Could a quick fix be to enable Subgraphs from Flowchart for Class Diagrams as well?

This issue is still open.

Due to some issues that I ran into when trying to implement this, I decided to wait until the new rendering engine is ready to continue. However, Im not sure when that will be, so maybe I should start working on this again :)

Ive been on "hiatus" from the project the past month or so to deal with other issues. You know, just some random things going on with family, the world, whatever ;)

Im getting ready to start up again, and this is one of the main issues I intend to come back to

馃憤 would love to see this in mermaid... lack of this feature had me going back to plantuml...

Should packages be nestable?
I would like to have nestable packages / namespaces.
My use case is related to representing packages or submodules inside microservices.
I also want to represent microservices as packages / namespaces and annotate them with stereotypes.
I will try to add examples in the future.

Any update on this?

Sorry, no - I had put the work on hold until the new version of rendering engine was completed. Now that this is in place I will get back to this item

Cool, thanks for the reply!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lth946965333 picture lth946965333  路  3Comments

tylerlong picture tylerlong  路  5Comments

mestaritonttu picture mestaritonttu  路  3Comments

chen4221 picture chen4221  路  3Comments

lwalker-kforce picture lwalker-kforce  路  3Comments