Book a Demo

Author Topic: C# reverse engineering / diagramming  (Read 5923 times)

jaschag

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
C# reverse engineering / diagramming
« on: April 14, 2007, 02:31:04 am »
Hi,

After reverse engineering an assembly, is it possible to stop the property getters/setters from showing in a diagram? When I uncheck the Property Methods checkbox, the properties disappear but the getters/setters are still shown - is this the correct behaviour?

Thanks,

Jascha

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: C# reverse engineering / diagramming
« Reply #1 on: April 14, 2007, 03:29:40 am »
Hi Jascha,

Can you post an exact illustration of what's happening before and after you set the check box.

I have some issues with the way EA handles Properties in general (See: [size=13]Property Redux[/size]).  But I'm not sure I've seen what you're describing.

It may be you haven't got the settings right, but until we see exactly what you mean, it's difficult to suggest a remedy as EA has a UI (Unique Interface)

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

jaschag

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: C# reverse engineering / diagramming
« Reply #2 on: April 14, 2007, 11:14:37 am »
Hi Paolo,

I wasn't sure how to add images easily so I will describe in a bit more detail. Assume a class:

public class MyClass
{
 public int MyProperty
 {
   get {...}
   set {...}
 }
}

With the following checked in diagram property settings:

Visible Compartiments: Operations
Visible Class Members: Public, Property Methods

I see

===
get_MyProperty
set_MyProperty
---
MyProperty
===

If I uncheck Property Methods, I only see

===
get_MyProperty
set_MyProperty
===

What I want to do is see the property but not the accessor methods but I can find no combination of settings that achieves this.

Thanks,

Jascha

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: C# reverse engineering / diagramming
« Reply #3 on: April 14, 2007, 02:37:32 pm »
HI Jascha,
Check the language settings of BOTH the Class and the property dialog of the property itself.

IIRC, even if you set the language property to C#, the property doesn't default tot he language setting of the class.

Did you read my redux?  For C#, the getters and setters shouldn't be named in that way (IIRC if the settings are correct, they aren't).

Let me know what you find and what happens if you play with the settings.

Oh, what version of EA are you using?

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

jaschag

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: C# reverse engineering / diagramming
« Reply #4 on: April 15, 2007, 01:48:45 am »
Hi Paolo,

These classes are a result on a reverse engineer on a .net 2 assembly (originally C#) so I do not control the naming of the property accessor methods. You were right that the classes were not marked as C# but when I do mark them as such it makes no difference. There seems to be no way to specify the language of the class members themselves (as I would expect) so no go in that respect. I noticed that the properties are marked correctly with the property stereotype (but there is no specific property method stereotype). My feeling is that the visibility setting for Propery Methods should specify the visibility of the properyy accessors (getters/setters) and not the properties themselves but this is not what happens. I still cannot find a setting config that shows the properties but not the accessors so I have had to manually delete all the accessors which is a pain in the **** to say the least. I am an EA fan but the reverse engineering and this specific issue have dented my faith slightly. If you have any other suggestions I would be very happy to try them.

Thanks again,

Jascha

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: C# reverse engineering / diagramming
« Reply #5 on: April 15, 2007, 06:14:44 am »
You can change the language specifically for Property members.  I think you still need to check what language the Properties are being set to.  Check the little builder [...] button to the right of the Property name in the Attributes dialog.

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

jaschag

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: C# reverse engineering / diagramming
« Reply #6 on: April 15, 2007, 08:45:57 am »
Quote
Check the little builder [...] button to the right of the Property name in the Attributes dialog.

There is no builder button there and all the other ones do not allow language selection. Also, the properties have been imported as operations and not attributes which may or may not be correct (I would have expected attributes).

Jascha

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: C# reverse engineering / diagramming
« Reply #7 on: April 15, 2007, 12:58:26 pm »
You will see the behaviour described (properties, plus the separate accessor methods hidden normally by .Net) when importing .Net assemblies by disassembly.  You only get the property stereotyped methods when importing from .Net, and in version 7 we've also stripped out the special get_ and set_ methods for disassembly import.
« Last Edit: April 15, 2007, 12:58:44 pm by simonm »

jaschag

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: C# reverse engineering / diagramming
« Reply #8 on: April 18, 2007, 06:13:44 am »
Quote
You will see the behaviour described (properties, plus the separate accessor methods hidden normally by .Net) when importing .Net assemblies by disassembly.  You only get the property stereotyped methods when importing from .Net, and in version 7 we've also stripped out the special get_ and set_ methods for disassembly import.

Ok, so I need version 7 - is there a release date?

May I ask why properties are imported as Operations as opposed to Attributes?

mikewhit

  • EA User
  • **
  • Posts: 608
  • Karma: +0/-0
  • Accessing ....
    • View Profile
Re: C# reverse engineering / diagramming
« Reply #9 on: April 18, 2007, 08:51:01 am »
« Last Edit: April 18, 2007, 11:05:50 pm by mikewhit »

jaschag

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: C# reverse engineering / diagramming
« Reply #10 on: April 18, 2007, 09:18:13 am »
3) Thank you very much

1) TOTM?