Book a Demo

Author Topic: Renaming Template Classes  (Read 3473 times)

MPfeffer

  • EA Novice
  • *
  • Posts: 2
  • Karma: +1/-0
    • View Profile
Renaming Template Classes
« on: April 20, 2020, 04:34:07 pm »
Hi everyone,

I am new to Enterprise Architect and currently evaluating the product. Therefore I tried the following:
1. Created a class diagram
2. Created a template class (a class with a template parameter) named "MyTemplateClass"
3. Create a class named "MyClass" that uses the template class as the type of an attribute (e.g. MyTemplateClass<int>)
4. Renamed "MyTemplateClass" into "MyFunkyTemplateClass"

Expectation: The type of my attribute in MyClass will be renamed, too (just like with non-template classes). It works when I don't use it with <int> but of course using a template class without the template parameter defeats the purpose.
Observation: The class will be renamed but the type of the attribute will not.

What am I doing wrong here or how can I achieve the described behaviour?
Can anybod help me here?

Thank you,
Marcus

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Renaming Template Classes
« Reply #1 on: April 20, 2020, 05:50:58 pm »
Hi Marcus,


And welcome to the forum. :)
Please note that like most of us here I'm just another user. Sparx do monitor these forums and often participate in discussions, but this isn't an official support channel.

EA's handling of attributes is a mix of data types (eg int), which are configured by language, references to other classes, and free text. It's a bit messy, TBH.

The first thing to check is whether it's a presentation issue where the client lags behind the database.
In the browser, highlight the package you're working in and select Contents -- Reload Current Package.
Also, closing and reopening the diagram can sometimes resolve this kind of issue.

If that doesn't help then the attribute type is indeed not updated when it should be.
The "correct" thing would then be to use a directed association in place of the attribute. This would allow you to express the "class-A has an attribute of type class-B" concept but without the textual attribute type label that EA fails to update.
Connectors of this kind are not shown in the list of attributes, so it's not a satisfactory solution, but it is semantically valid.

HTH,


/Uffe
My theories are always correct, just apply them to the right reality.

MPfeffer

  • EA Novice
  • *
  • Posts: 2
  • Karma: +1/-0
    • View Profile
Re: Renaming Template Classes
« Reply #2 on: April 20, 2020, 11:13:28 pm »
I just tried your suggestion, but unfortunately it didn't work.

Thank you anyway,
Marcus