Package without compound in a class diagram

0 votes
asked Oct 28, 2014 in Bug by rmric (2,140 points)

Hi,

It looks like Plantuml (8008beta) can't manage to render package without a compound in a class diagram.

While the following would be accepted:

class Class1
package Package2 {

}

The following example returns a syntax error:

class Class1
package Package3

Could it be an issue easily fixed in plantuml ?

TIA

1 Answer

0 votes
answered Oct 28, 2014 by plantuml (295,000 points)

Hello,

Actually, we had to slightly change the parser to allow future improvements, and this syntax has been removed.

Changing the syntax (and so breaking ascending compatibility) is something that we try to always avoid, but unfortunatly, there are some cases where we have to.

There have been really few breaks in compatibility since PlantUML's begin (maybe 2 or 3). Because the definition of the language is done in incremental steps, this is the price we have to (sometime) pay.

That's the meaning of the warning in the What's New ? page:

16 Jan, 2014: Warning: legacy syntax with end package and end namespace will be soon removed. Ensure that you are using the bracket notation

If you want to have a one-line definition for the package, you can also use the following syntax:

class Class1
package Package3 {}

We hope that is not a big issue for you.

Regards,

commented Oct 28, 2014 by rmric (2,140 points)
Thank you for your answer and the explanation. Managing compatibility is indeed an uneasy task.

Unfortunately, my need is not a one-line definition, but the ability to bear no compound. This is due to the fact that I'm using macro's across class diagrams and sequence diagrams, however sequence diagrams for sure won't accept compounds :-(
commented Oct 28, 2014 by plantuml (295,000 points)
Could you post a simple example of what you are trying to do (with a macro, a class diagram and a sequence diagram) ?
We may find another fix/solution.
Thanks,
...