Book a Demo

Author Topic: EA looses type of generic parameter T  (Read 2850 times)

bjoerk

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
EA looses type of generic parameter T
« on: September 01, 2007, 11:59:49 am »
I'm using EA just for some weeks, so maybe I'm doing things wrong.

For example I create a generic c# class with EA and generate the code:

public class Class1<T> where T : BaseObject {...}

Until now it's fine, I can compile the class in VS 2005 and use the class as I want.

But as soon I synchronize the model with the code from VS 2005, EA looses the type parameter information of T.
It happens also if I don't change the code after generating from EA, and just synchronize it back.

Somebody has the same problem?

Thank you in advance.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: EA looses type of generic parameter T
« Reply #1 on: September 01, 2007, 12:29:28 pm »
Sounds broken to me.

First, make sure you are using build 816; it has just come out and there were a lot of updates.

If the problem is still occurring, and if nobody posts a workaround in the very near future, I suggest you submit a bug report on this to Sparx. That will hopefully bring the problem to their attention in time for build 817 (or so).

Here's what we do when submitting bug reports, in the hope of getting the best flow of information:

You might want to open a second browser page to make the report. You can reach the correct report page by clicking the Report a Bug link below the Support link at the bottom of any forum page. Please quote the name of this thread, and past in a link to the thread (that's why you made the report using a new browser page). That way Sparx can participate in this discussion, as well as getting any additional context the thread may contain.

If you get a response from Sparx - they may suggest a workable solution, or provide an estimate of when it will be resolved - please let us know in this thread.

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

bjoerk

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: EA looses type of generic parameter T
« Reply #2 on: September 02, 2007, 12:44:54 am »
Hello David.

I'm using the lastest build 816, so I just made what you suggested, and I hope the problem can be solved soon.

Thank you for the explanation of how to do it.

In the meantime I found out some more problems with generic c# classes.

The command "View code" in the EA Project Explorer inside of Visual Studio does'nt work with generic classes. (With no error message)

The same problem if I use the command "View source code" inside of EA. (Error message  with code #80004005, that says the class could not be found because of multiple namespaces).

I already mentioned these two issues in my bug report.

Does anybody else have the same problems?

Björn

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: EA looses type of generic parameter T
« Reply #3 on: September 02, 2007, 05:40:45 am »
Hi Björn,

You are certainly correct about generics. Search this forum for a bit of help, but you won't be able to do everything you want. EA still has very little support for generics.

This has been commented on and suggested numerous times, but appears not to have made it into version 7. I for one do not want to wait until version 8 too see generics handled gracefully.

I suspect (entirely without proof) that the necessity of stepping beyond the bounds of the current code engineering 'engine' is at the root of the problem. Still, the precedent has been set, as EA's support for C++ has required all sorts of customizations.

Perhaps you'd make a (yet another) suggestion to this effect. The best practice is the same as with bug reports, except that you'll be starting a new thread in the Suggestions and Requests section of the forum, and targeting generics specifically.

I for one will (once again) express my support. At some point these will probably reach critical mass, with a net positive benefit, and Sparx will come up with something.

David

PS: I've stayed entirely out of the debate about the value and 'purity' of generics. The fact is that they are here.
No, you can't have it!