Author Topic: Code Generation of Linked Attributes  (Read 6982 times)

LNS_Software

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Code Generation of Linked Attributes
« on: September 21, 2004, 01:17:56 pm »
I am trying to determine how to get the stereotype of a linked attribute.  I am developing a model that also includes hooks for future capabilities.  I have stereotyped the class and association as "future".

I've updated the template for the class to:
  %if classStereotype == "future"%
  %endTemplate%

But cannot seem to find the stereotype for a linked attribute.  

Also, how does a Linked Attribute template start?  According to the class body, it uses a %list to include the attributes, but in attributes there is no hook to Linked Attributes.

Any ideas?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8083
  • Karma: +118/-20
    • View Profile
Re: Code Generation of Linked Attributes
« Reply #1 on: September 21, 2004, 04:13:44 pm »
Hi,

Currently there is no way to get a link stereotype.  The list of possible substitution macros is available in the help.

http://www.sparxsystems.com.au/EAUserGuide/fieldsubstitutionmacros.htm

Also in the help is this.

Quote
There are some special cases to consider when using the list macro:
 ยท If the Attribute template is used as an argument to the list macro, this will also generate attributes derived from associations by executing the appropriate LinkedAttribute template


That can be found at http://www.sparxsystems.com.au/EAUserGuide/controlmacros.htm

Hope this helps.

Simon

LNS_Software

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Code Generation of Linked Attributes
« Reply #2 on: September 22, 2004, 02:03:53 pm »
I cannot get at the Linked Attributes.  If I try to create a custom template, "Linked Attribute" does not appear.

If I say:
%list="Attribute__ListAttributes" @separator="\n\n" @indent="\t"%

I only get the attributes, I don't get the linked attributes.

(I'm hoping it doesn't come down to having to build one of those unsupported ADD-IN's).

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8083
  • Karma: +118/-20
    • View Profile
Re: Code Generation of Linked Attributes
« Reply #3 on: September 22, 2004, 07:19:38 pm »
Well, you do have a bit of a problem there... At the moment you can't create a custom template for linked attributes, and executing a custom template for attributes does not and is not intended to also execute linked attributes.

I do have some good news for you though...

There is actually a way to get In response to this I have included the ability to get the stereotype of a linked attribute.   The substitution macro %linkStereotype% hasn't been documented but does work.   :-[

The other thing is that I've added the ability to create a custom template for linked attributes that you should get in build 738.

I'll also try to complete (I think) the options for that by adding ability to create custom templates for "ClassBase", "ClassInterface" and "ClassParameter"

Simon

LNS_Software

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Code Generation of Linked Attributes
« Reply #4 on: September 22, 2004, 08:12:19 pm »
While you're at it, can you add a couple of things that can be referenced in a linked attribute.  
  • Specifically accessing the source aggregration so I can tell whether the linked attribute is a shared or composite aggregation.
  • A way to access the notes of an association.
  • A way to access the tags of an association.
Thanks.