Book a Demo

Author Topic: C# Attribute  (Read 4425 times)

knopfi

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
C# Attribute
« on: October 03, 2007, 11:20:26 pm »
Hi all,

I'm looking for a way to model in a class diagram that a C# class has an attribute on it (e.g. [Serializable]). Is there any way to do that?

I'm using EA Version 6.5.802.

Thanks for any help.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: C# Attribute
« Reply #1 on: October 04, 2007, 01:02:07 pm »
It's in a tagged value 'Attribute'.

knopfi

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: C# Attribute
« Reply #2 on: October 04, 2007, 08:53:16 pm »
Hi Simon,

thanks for your quick response. But since I'm an EA newbie I would require some more details.
In a class diagram I added a new class. In the classes context menu I selected "Add->Tagged Value ...".
But no matter what I select/enter here, nothing is displayed in the diagram.
Or am I totally wrong?

Holger

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: C# Attribute
« Reply #3 on: October 04, 2007, 09:14:41 pm »
Hi Holger,

as you're already discovering, the EA UI is not as intuitive as it claims.  However, to solve your problem, select the Class, hit [Ctrl+Shift+Y] (Set Feature Visibility) and mark the Tags (and/or Inherited Tags) check boxes and the Tags should now be visible on the diagram.

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

knopfi

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: C# Attribute
« Reply #4 on: October 05, 2007, 02:15:30 am »
Hi Paolo,

thank you for pointing me in the right direction.
I created a custom tagged value type named "Attribute" and assigned the classes C# attribute as a value.
After setting the correct visibility I got the desired result.  :)

So at least this is a way to document C# attributes in EA.
Of course it would be much better if these attributes would be fully supported by EA.
This would mean that they are automatically created via Reverse Engineering and would be considered in code generation, too.

Thanks again
Holger

knopfi

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: C# Attribute
« Reply #5 on: October 05, 2007, 02:21:51 am »
An additional note:

One of my colleagues just found, that C# attributes are considered in Reverse Engineering by creating a tag of type "Attribute"!  :)