Multilingual Wiki Documentation

You are currently using syntax.
In an attempt to improve PlantUML documentation...

Recent changes    Wiki Toc    View page history    Reorder page    Raw

Issue about Namespace and Package

Right now, the management of namespace and package may sound odd to users.

The real reason of this a some bad design decision made 10 years ago.

So here is our new proposal:

Merge the notion of package or namespace in PlantUML so that package or namespace will be synonymous and behave as in all regular programming languages.

Before proceeding to the vote, please read carefully the whole proposal. Your vote will have an impact on the future of PlantUML :

  • and keep the actual behaviour of PlantUML.
  • I understand that I may have to add set separator none to some old class diagrams to let them work as today.
  • that won't break ascending compatibility.

You just have to click on one of the buttons to vote.
PlantUML Team
Welcome !
All contributions made here are public.
Thanks for helping us to improve PlantUML documentation !
Anonymous2020/01/03 09:23:25
BallAndSocket sould be supported.
Example: classA --(interfaceA) )-- classB

Proposition of new behaviour

By default, the dot . will be interpreted by PlantUML as a separator.

If users vote for this change, the following diagram:

@startuml
package net {
  class foo1
}

package net.entities {
  class foo2
}

package net.entities.sub {
  class foo3
}
@enduml

will now be printed as :

Note that the drawing is different from what PlantUML gives right now.

The following diagrams will give the same image:

@startuml
package net {
  class foo1
 
  package entities {
    class foo2
    
    package sub {
      class foo3
    }
  }
}
@enduml

or

@startuml
class net.foo1
class net.entities.foo2
class net.entities.sub.foo3
@enduml

Note that if you prefer, you could change package to namespace in those examples and you will get the same image.
PlantUML Team
You can use this chat to ask questions or to give any feedback on Proposition of new behaviour
Anonymous2019/12/14 14:13:36
I really don't like this change. I've just started using PlantUML and learning JSON. This seems to go against my intuition.
Anonymous2019/12/15 12:23:53
Could you detail your idea ? This change is unrelated to JSON, so I'm confused.
Anonymous2020/01/08 03:50:47
I like `set separator <character>`. I also like the containment syntax. That is important to be able to do cleanly and picking up that hint from the "package" declaration is a useful bit of syntax. --Frotz
Anonymous2020/01/09 10:18:45
What would be rendered if the top-level namespace / package is empty, except for another namespace? Will it still render as a box in a box, or will the name of the inner namespace be rendered as "net.entities"?

Separator change

As previously said, as the . is the separator, you will also have:

@startuml
'Since there are no "dot" in packages names, there are displayed flat
package net {
  class foo1
}

package net_entities {
  class foo2
}

package net_entities_sub {
  class foo3
}
@enduml

So if you want to use the underscore as a separator, you will have to write:

@startuml
set separator _
package net {
  class foo1
}

package net_entities {
  class foo2
}

package net_entities_sub {
  class foo3
}
@enduml

This will display:

This separator feature would also be useful to retrieve the current behaviour, if you don't want the dot . to be interpreted as a separator.

For example, you could have:

@startuml
set separator $
' you could also use "set separator none"
package net {
  class foo1
}

package net.entities {
  class foo2
}

package net.entities.sub {
  class foo3
}
@enduml

which would display:

Here we fall back to the actual drawing.

Once again, you could change package to namespace in those examples and you will get the same images.
PlantUML Team
You can use this chat to ask questions or to give any feedback on Separator change
Anonymous2019/12/15 09:52:43
what about a sequence of characters (e.g. '::') as a separator? I assume the new solution does include this.
Anonymous2019/12/15 12:20:53
With the new solution, you will be able to use "set separator ::" if you want to.
Anonymous2020/01/10 21:39:13
How about a no separator option to disable it? like "set separator off".
Anonymous2020/01/11 16:36:15
Isn't double colon a uml way to define nested packages?
I'd prefer to use "::" as a default separator, not "."


Please report any bugs to plantuml@gmail.com or here.
This website is still in beta testing.