Book a Demo

Author Topic: Generics with C#  (Read 2130 times)

Stringer

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Generics with C#
« on: September 07, 2007, 02:47:43 pm »
Okay, I have a C# source like this (simplified):

class Object
{
   public string Name;
}

class ObjectList
{
   public List<Object> Objects=new List<Object>();
}

class SimpleObject
{
   public Object MyObject=new Object();
}


Now the problem is, SimpleObject will be associated to the Object, but ObjectList won't be. However, that List definently uses the Object and my common sense says it should somehow show in the model.

Is there anything that can be done to make it work without manually connecting all associations like these?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Generics with C#
« Reply #1 on: September 07, 2007, 03:24:00 pm »
Hey Stringer,

I'm sorry to say that the news is not too good on this.

This has been planned for "a future release" for some time. Unfortunately the future release appears not to have been version 7.0.

Do a search on the word "generics" and you'll get some relevant threads. If memory serves there is a link from someone at Sparx to a paper showing how to get (very) limited support for these.

Why not put forth a feature request to Sparx. Each time someone does so it will (or should, at least) help that feature rise to the top of the stack. Search my recent posts (last week or two) for a best practice we use for doing this while keeping the rest of the user community in the loop.

David
No, you can't have it!