Book a Demo

Author Topic: Reverse c# and collection: no link between classes  (Read 4390 times)

flamandier

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Reverse c# and collection: no link between classes
« on: November 26, 2009, 02:45:34 am »
Hi ,

I am sorry to ask a dumb question if it is the case , but I am new to EA.

I made a reverse of my C# 2.0 project  ,and I noticed that reversing collections does not lead to create a association between classes.

Example  to be clear :

public class X
{
...
List<Y> m_listofY = new List<Y>()
}

If I reverse, and then put classes  X and Y in the same class  diagram, no link is created between them  .

Hope that you can help me !

« Last Edit: November 26, 2009, 02:46:12 am by flamandier »

flamandier

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Reverse c# and collection: no link between cla
« Reply #1 on: November 28, 2009, 02:56:56 am »
nobody to help me ? :'(

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: Reverse c# and collection: no link between cla
« Reply #2 on: November 28, 2009, 04:47:53 am »
Hi,

EA currently doesn't support using generics as container field types for 1:n associations AFAIK. There was another thread recently mentioning this issue, sorry I wasn't able to find it now.
As far I remember, there was also a reply from a Sparxian, that they plan to support it in a future version (correct me if I'm wrong with this please).

WBR
Günther

Kevin G. Watson

  • EA User
  • **
  • Posts: 217
  • Karma: +0/-0
  • I love EVERYTHING including Microsoft
    • View Profile
Re: Reverse c# and collection: no link between cla
« Reply #3 on: November 30, 2009, 08:31:14 pm »
Hi

I s'pose pointing out that there is no direct relationship between X and Y, is a bit pedantic.

List<Y> is a realization of a template-class (I think thats the UML name) 'List',  which is dependant on Y.

ya 'X' class is only indierectly related to 'Y'....

I haven't got EA loaded on this machine else I'd show it... might after lunch.

Kevin

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Reverse c# and collection: no link between cla
« Reply #4 on: November 30, 2009, 09:08:24 pm »
Kevin,

Although what you are saying is of course correct, I think it is fair to say that, having an attribute in class A of type List<B> is the technical implemenation of a functional association A (0..1) -->(*) B.

Geert
« Last Edit: November 30, 2009, 09:08:45 pm by Geert.Bellekens »

Kevin G. Watson

  • EA User
  • **
  • Posts: 217
  • Karma: +0/-0
  • I love EVERYTHING including Microsoft
    • View Profile
Re: Reverse c# and collection: no link between cla
« Reply #5 on: December 02, 2009, 07:45:38 am »
Hello again... sorry about delay, yestarday was busier than I thought.

Here's what I think the construct should look like (I've used VS2kx's UML Diagram)...
The illustration below, I think is getting closer to what flamandier was expecting, and Greet expressed (thank you by way, I thought I was on quite firm ground) personally I rather like the non-standard notation on the asCollectionAssociation to Y; it gives a visual clue to something being abstracted away... expressing that X does reference Y.

Lots of folks that I work with, expect to have to read the code and model to understand whats happening... little things like implicitly occluding these types of constructs lead to that thinking.

If youre going to reverse engineering from source to model, then we ought to be able to choose what we show in a diagram... else we'll be inspecting text for ever more.

Appologies for my appalling spelling...

Kevin [smiley=2vrolijk_08.gif]
ps. there are 3 fields in X, all defined as List<Y> in the second diagram

Severn

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Reverse c# and collection: no link between cla
« Reply #6 on: December 08, 2009, 02:31:22 am »
I also want to ask - when does EA support generic classes
cuch as collections ?
Now I'm working at new system and I try import classes from program code on C#.
And it shows me something quite different from my program classes.