In an attempt to improve PlantUML documentation...
Wiki Toc Recent changes View page history Add new chapter Reorder page Raw
![]() |
![]() |
Issue about 命名空间 and 包Right now, the management ofnamespace and package may sound odd to users.
The real reason for this is 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.
!pragma useNewPackage directive to your diagrams to activate the new package behaviour.
|
Issue about Namespace and PackageRight now, the management ofnamespace and package may sound odd to users.
The real reason for this is 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.
!pragma useNewPackage directive to your diagrams to activate the new package behaviour.
|
|
Beta testing this new featureThe pool shows that the vast majority of users are welcoming this change. Since this change may have some impact on existing diagrams, we are going to move slowly on this new feature. Note that many diagrams are impacted by this changes: Other diagrams (including sequence diagrams and activity beta diagrams) are not impacted. For starting, we need feedback from users to know if we still are on the right path. So last beta last beta plantuml.jar and the online server provides now a convenient way for testing this feature. Those versions temporary implement both behaviours. You just have to add!pragma useNewPackage directive to activate the new package behaviour.
If you are already using PlantUML, it is very important that you test now this beta feature. Indeed, nothing has been definitively settled yet, so feedback will help us to find out any regressions.
This way, we will commit the right change for you. And when this beta feature will become the default behaviour, your diagrams will be safe.
|
|
Proposition of new behaviourYou can use!pragma useNewPackage to enable the new behaviour.
By default, the double colon :: will be interpreted by PlantUML as a separator.
Even if package are not explicitly nested, they will be printed as nested:
The following diagrams will give the same image:
or
Note that if you prefer, you could change package to namespace in those examples and you will get the same image.
|
|
Separator changeFollowing first poll result, the double colon:: is the default separator. You can still vote so that we decide to confirm this.
What should be the default value for set separator directive:
:: is the default separator. But you can change it using set separator directive.
This separator feature would also be useful to retrieve the current behaviour, if you don't want the double colon :: to be interpreted as a separator.
For example, you could have:
Here we fall back to the actual drawing of legacy PlantUML version. Once again, you could change package to namespace in those examples and you will get the same images.
If using set separator none do not give you an acceptable result, please contact us.
|
|
Nested namespacesSetting separator tonone disable the merge of nested packages.
For example, compare :
and
|
|
FeedbackIf during your tests you find some issues:
|