Sparx Systems Forum

Enterprise Architect => Suggestions and Requests => Topic started by: Uffe on August 11, 2009, 04:20:47 pm

Title: Unique Element Names within Package
Post by: Uffe on August 11, 2009, 04:20:47 pm
Hey everyone,


This feature takes off from a discussion regarding namespaces and uniqueness of element names that came up in http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1249546103.

EA does not enforce unique element names within a package, and I'm pretty sure it cannot do so and remain UML compliant. The standard only says that an element must have a name, it doesn't say anything about uniqueness.

However, names within a context do need to be unique in order for the model to be properly understood - either by a person or by a compiler.

So I propose adding an Object option, "Warn about duplicate element names", which would flash a confirmation dialog whenever you tried to give an element a name that another element in the same context already has, ie element in package, class in outer class, etc.
This would apply to name entry during create/rename, as well as when moving an element from one context to another. You wouldn't want it during imports, although perhaps it might be useful to see a list of such offending elements in the import output.

In addition, a model validation rule should be added to check for uniqueness of element names within each context.

Cheers,


/Uffe
Title: Re: Unique Element Names within Package
Post by: Paolo F Cantoni on August 11, 2009, 05:03:51 pm
Well presented!

Gets my vote!

Paolo
Title: Re: Unique Element Names within Package
Post by: Geert Bellekens on August 11, 2009, 05:30:38 pm
Gets my vote if we rephrase that to:
"Element name must be unique within namespace"
In this case the "Namespace" refers to the UML concept of namespace (not the EA Code Engineering concept) as this is a well defined concept within UML that enforces this rule.
We might even go further and not allow duplicate names within a namespace when the option "Strict UML syntax" is selected.

Geert
Title: Re: Unique Element Names within Package
Post by: «Midnight» on August 11, 2009, 10:30:16 pm
But clearing the strict UML option (or some other means) should disable this check. The result of doing so would be that EA would work as it does now.