Re: Ikvmstub support for introducing generic signatures
Jeroen Frijters <[email protected]>
| Newsgroups | gmane.comp.java.ikvm.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi, I've thought about this a lot and I've not been able to come up with a way to do this automatically that doesn't suffer from lots of complications. The easiest solution is to write a C# facade that provides a .NET friendly interface. Regards, Jeroen From: John Park [mailto:[email protected]] Sent: Wednesday, December 11, 2013 22:28 To: [email protected] Subject: [Ikvm-developers] Ikvmstub support for introducing generic signatures Hi there, I'm currently writing a C# library (a SDK) that can be used by Java code for interoperability between the Java code, that is to be compiled to a .dll file using ikvmc, and a larger .NET project. As of now, I am using java.util libraries for methods/properties within the C# SDK using IKVM.OpenJDK.Core.dll that can be called on Java side, e.g. using System; ... namespace SomeNamespace { public class SomeCSharpLibraryClass { ... public static java.lang.List GetSomeList() { ... return .... } public static java.lang.Map GetSomeMap() { ... return ... } ... My understanding is that Java removes generics during runtime, which is fine with me. However, would it be possible when the C# library is compiled to introduce generic signatures into the methods into stub .class files? So using the above examples again, instead of having import SomeNamespace.*; ... List someList = SomeCSharpLibraryClass.GetSomeList(); Map someMap = SomeCSharpLibraryClass.GetSomeMap(); on the Java side, is it possible to have something like List<String> someList = SomeCSharpLibraryClass.GetSomeList(); Map<String, Integer> someMap = SomeCSharpLibraryClass.GetSomeMap(); by introducing the generic signatures String and (String, Integer) to the two methods in the .class file after the C# library's been compiled using ikvmstub? Otherwise, if there is no such option, what other alternatives are there to achieve the same functionality? Since this C# library will be used by others, using C# generic classes (e.g. IEnumerable<string>, IDictionary<string, string>), which generates lengthy explicit class name, is not really preferable. Thank you for your time. ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk _______________________________________________ Ikvm-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ikvm-developers