plantuml / plantuml

Generate diagrams from textual description
https://plantuml.com
Other
9.73k stars 881 forks source link

force notes to use inner namespaces not global namespace only #1405

Closed grivo closed 3 months ago

grivo commented 1 year ago

Describe the bug note names clash despite being declared at different namespaces

To Reproduce

  1. this works
    
    @startuml
    class Cls

package X { class Cls } @enduml

2. that works as well

@startuml class Cls

class X.Cls @enduml


3. notes declaration don't work

@startuml note as n my note end note

package X { note as n my enother note end note } @enduml


4. neither this pattern works

@startuml note as n my note end note

note as X.n my enother note end note @enduml

The-Lum commented 1 year ago

Hello @grivo, and all,

Yes: because actually notes must have absolute name, regardless of namespace usage.

Perhaps create a Wanted feature to do that.

Regards.

grivo commented 1 year ago

hmm... can't find any namespaces restriction for comments at UML 2.5 specs

if it's rather PlantUML restriction - then you're right, it'll be wonderful to convert this issue to a type of wanted feature... or I can do it by myself somehow, I wonder?

The-Lum commented 1 year ago

if it's rather PlantUML restriction

Yes, You are right.

This is now a wanted feature for PlantUML.


Then, for PlantUML team, here is the minimal example to be manage by plantuml:

Could you manage:

@startuml
note as n
    my note
end note

package X {
    note as n
        my enother note
    end note
}
@enduml

As:

@startuml
note as n
    my note
end note

note as X.n
    my enother note
end note
@enduml


Regards.

grivo commented 8 months ago

problem remains the same for usecase diagrams, should be this ticket reopened?

grivo commented 8 months ago

issue eliminates ones allowmixing is applied and actor keyword is used instead of : <value> :

@startuml
allowmixing

package x {
  note as _n
    qwerty
  end note
}

package y {
  note as _n
    asdfg
  end note

  actor "myActor" as a
}
@enduml
grivo commented 8 months ago

this does not work

@startuml
package x {
  note as _n
    qwerty
  end note
}

package y {
  note as _n
    asdfg
  end note

  :myActor:
}
@enduml

neither this works (even with allowmixing)

@startuml
allowmixing

package x {
  note as _n
    qwerty
  end note
}

package y {
  note as _n
    asdfg
  end note

  :myActor:
}
@enduml
arnaudroques commented 8 months ago

Using set separator . improves the result.

This setting is by default for class diagrams. Maybe we should set it also by default for usecase diagrams.

We are unsure here about what it the best behavior. Any though?

grivo commented 7 months ago

Maybe we should set it also by default for usecase diagrams.

i think this is quite good option... since package and namespace are the same for class diagrams - so namespace alike behaviour for package items anywhere else (usecases, deployments, etc) should be perfect solution

Using set separator .

so i think that should be turned on everywhere, at least for all UML diagrams types that may use packages

thanks!

grivo commented 3 months ago

it works now!

@startuml
note as n
    my note
end note

package X {
    note as n
        my enother note
    end note
}
@enduml

as well as

@startuml
note as n
    my note
end note

note as X.n
    my enother note
end note
@enduml