What's the difference between a package and a namespace?

+1 vote
asked Mar 28, 2019 in Question / help by lockywolf (400 points)
As far as I understand, UML doesn't specify such a thing as a 'namespace'. Am I wrong?

On the other hand, PlantUML allows two ways of grouping things. One is namespaces on a class diagram, the other is a package/component diagram.

Why was such a decision chosen? I have recently learned about allow_mixing, which, I believe, would allow me to put classes into packages, but would it be standard UML?

1 Answer

0 votes
answered Feb 3, 2020 by g.edward.roberts (480 points)
referring to UML 2.5.1... Namespace is an abstract class... a Package is a Namespace but so are a lot of other things like e.g. a Class... so yes there is a notion of a Namespace in the standard...

PlantUML essentially states that all NamedElements in a model are unique (i.e. not distinguished by namespaces) unless Namespaces are used (i.e. with QualifiedNames for things)...

PlantUML uses the term Namespace essentially as a Package that has fully qualified names...
...