Book a Demo

Author Topic: C# virtual methods and attributes(properties)  (Read 4562 times)

J2T

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
C# virtual methods and attributes(properties)
« on: August 31, 2008, 06:59:13 am »
Hi Community,
i'm really new in EA and need u're help please  :)

The problem is that i don't know exact who i have to mark a method or properties virtual!

For methods i thought it could be 'pure' but when i choose those it always becomes 'abstract' too!And a virtual method isn't a abstract method in c#!

For properties theres only the option 'abstract'!Maby in EA 'abstract' and virtual are the same?!

I hope someone can help me  ;)
« Last Edit: August 31, 2008, 06:59:49 am by J2T »

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: C# virtual methods and attributes(properties)
« Reply #1 on: August 31, 2008, 07:31:08 am »
Look up C# | Modeling Conventions in EA Help. You'll find virtual near the lost of tagged values. I suspect this is what you are looking for.
No, you can't have it!

J2T

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: C# virtual methods and attributes(properties)
« Reply #2 on: August 31, 2008, 07:48:08 pm »
Thanks for your reply!
But i founded this page too but there only stands that virtual must exist!
But my problem is that i can't find where i can set a property/method virtual. There are only const,static,pure,abstract....

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: C# virtual methods and attributes(properties)
« Reply #3 on: September 01, 2008, 07:56:23 am »
I think you'll have to set up a tagged value, with tag name "virtual" (without quotes) and some kind of value. [Perhaps the value is unimportant, just so long as the tag is defined. Or the value might be an empty string or the Boolean value True.]

What 'thing' actually gets the tag would depend on what you are trying to define. It could be an attribute, operation or even a class.

Of course this does not actually solve your problem; you need an example to see how EA handles this...

I suggest you create a 'toy' piece of C# code with a virtual attribute, operation, or class. Then reverse engineer this into EA. You can then examine the various pieces of the resulting EA model - remember to open and dock the Tagged Value window so you can see what's going on - to see what gets defined where.

You can also export the resulting EA model to XMI and use a text editor to search for "virtual" (with quotes, either single or double).

HTH, David
No, you can't have it!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: C# virtual methods and attributes(properties)
« Reply #4 on: September 01, 2008, 09:02:17 am »
In the operations dialog there is an advanced button that contains additional options that are language dependent.  This results in the documented tagged values.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: C# virtual methods and attributes(properties)
« Reply #5 on: September 01, 2008, 10:21:38 am »
Thanks Simon,

I suspected it was around there someplace obvious, but I've not tried it in a while.

David
No, you can't have it!