Book a Demo

Author Topic: Modeling Java Generics with Interfaces  (Read 2950 times)

Mike_Jacobs

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Modeling Java Generics with Interfaces
« on: December 17, 2007, 09:13:13 am »
I would like to model parameterized Java interfaces and use code generation.  I see that classes can be parameterized, but not interfaces.

I would like to model:

public interface ITask<Target> {
 public Target getTarget();
}

Is there a way to do that?

Thanks,
Mike
« Last Edit: December 17, 2007, 09:13:38 am by Mike_Jacobs »

sslavic

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: Modeling Java Generics with Interfaces
« Reply #1 on: December 17, 2007, 05:43:33 pm »
There is a solution given in another topic on this same forum. Look here http://www.sparxsystems.com/cgi-bin/yabb/YaBB.pl?board=general;action=display;num=1197374126

effiban

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Modeling Java Generics with Interfaces
« Reply #2 on: January 15, 2008, 05:23:52 am »
The solutions presented in this link are somewhat of a hack. I suggest that a more straightforward solution be implemented in a future release. Any comments?