Book a Demo

Author Topic: Disallow creation of element with same name  (Read 3709 times)

Mats Gejnevall

  • EA User
  • **
  • Posts: 98
  • Karma: +1/-0
    • View Profile
Disallow creation of element with same name
« on: June 15, 2023, 06:47:44 pm »
We would like to get a warning whenever someone tries to create a new element of the same type and name as an existing element. Is there a way of doing this or does someone have a solution for dealing with this. The same really applies to relations, i.e. when you create a relation of the same type between two elements.

Thanks
Mats

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Disallow creation of element with same name
« Reply #2 on: June 15, 2023, 09:15:42 pm »
We would like to get a warning whenever someone tries to create a new element of the same type and name as an existing element. Is there a way of doing this or does someone have a solution for dealing with this. The same really applies to relations, i.e. when you create a relation of the same type between two elements.

Thanks
Mats
Mats, to do this properly is more complicated (which is probably why Geert had to script it).
What you are talking about is Namespace definition.
There are two basic dimensions:
Scope
Metatypes

Scope includes Repository-wide, Root-wide, branch-wide, Folder-wide etc.
Metatypes includes All Metatypes, Specific Metatypes etc.
Our repositories have many items with the same name, sometimes in the same folder.  In some folders, we allow multiple items with the same name so long as they are of different metatypes.  Occasionally we even allow multiple items with the same name and the same metatype.

So, simply disallowing duplicates would not be suitable.  However, it would be really cool if Sparx implemented a robust namespace management mechanism.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Disallow creation of element with same name
« Reply #3 on: June 15, 2023, 10:21:41 pm »
We would like to get a warning whenever someone tries to create a new element of the same type and name as an existing element. Is there a way of doing this or does someone have a solution for dealing with this. The same really applies to relations, i.e. when you create a relation of the same type between two elements.

Thanks
Mats
Mats, to do this properly is more complicated (which is probably why Geert had to script it).
What you are talking about is Namespace definition.
There are two basic dimensions:
Scope
Metatypes

Scope includes Repository-wide, Root-wide, branch-wide, Folder-wide etc.
Metatypes includes All Metatypes, Specific Metatypes etc.
Our repositories have many items with the same name, sometimes in the same folder.  In some folders, we allow multiple items with the same name so long as they are of different metatypes.  Occasionally we even allow multiple items with the same name and the same metatype.

So, simply disallowing duplicates would not be suitable.  However, it would be really cool if Sparx implemented a robust namespace management mechanism.

Paolo
Could not have word it better? Simply disallowing duplicates may not suitable or a good idea. We also have many duplicates in our repository, even of the same metatype, representing different things.

[SNIP]
However, it would be really cool if Sparx implemented a robust namespace management mechanism.
Seconded, I will even add that they should introduce a Folder element to encourage users to stop using packages as folders, when they are not.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Disallow creation of element with same name
« Reply #4 on: June 15, 2023, 11:51:52 pm »
[SNIP]
However, it would be really cool if Sparx implemented a robust namespace management mechanism.
Seconded, I will even add that they should introduce a Folder element to encourage users to stop using packages as folders, when they are not.
Indeed, we have stereotyped most "packages" as "folders" and we have also created special folder elements to allow correct nesting (such as tables in schemas etc.).  We do NOT encourage the export/import of non "package" stereotyped packages.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!