In an attempt to improve PlantUML documentation...
Wiki Toc Recent changes View page history Add new chapter Reorder page Raw
![]() |
![]() |
Probleme mit Namespace und PackageIm Moment scheint es für einige User merkwürdig anfühlen, wienamespace und package verwendet werden.
Der wahre Grund hierfür sind einige schlechte Designentscheidungen, die vor 10 Jahren gemacht wurden.
Daher ist hier unser neuer Vorschlag:
Die Verwendung von package und namespace in PlantUML soll zum gleichen Ergebnis führen und sich somit wie in allen regulären Programmiersprachen verhalten.
Vor der Teilname an der Abstimmung, lies bitte sorgfältig den gesamten Vorschlag.
Deine Stimme wird einen entscheidenen Einfluss auf die zukünftige Entwicklung von PlantUML haben:
|
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 behaviourNormalerweise wird der. als Seperator in PlantUML interpretiert.
Bei einer Änderung, nach Abstimmung mit den Usern, wird dieses Diagramm:
als dieses ausgegeben:
Achtung die Zeichnung sieht dann anders aus, als die bisherige Darstellung in PlantUML. Das folgende Diagramm wird das gleiche Bild erstellen:
oder
Anmerkung: Wenn gewünscht, kann das Schlüsselwort package durch namespace in diesen Beispielen ersetzt werden um das gleiche Ergebnis zu erreichen.
|
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:
|