Re: [Ikvm-developers] Implicit Casting from Int16/Int32 to java.lang.Integer?
Brought to you by:
jfrijters
From: Michael K. <mi...@sa...> - 2013-06-07 06:20:45
|
In my view if you're going to present an API that's acceptable to the .NET user and doesn't have "Java" stamped all over it, then you need to write a wrapper layer to your application (ours is written in C#) that implements that interface. Providing the same interface to Java and .NET users will never be satisfactory. Michael Kay Saxonica On 7 Jun 2013, at 07:11, axel stumpp (innoWake gmbh) wrote: > Hi, > > i own the java code, but it’s kind of a stable interface now and we don’t want to change the java world. > Another possbility would be to extend the java interface in .net and add the neccessary methods. I just wanted to know if someone else hast he same problem and if there is maybe a general solution (implicit casting by the ikvm implementation of java.lang.x) > > Thanks for your answers J > > Greetings, > Axel > > Von: Volker Berlin [mailto:vol...@go...] > Gesendet: Donnerstag, 6. Juni 2013 21:46 > An: ikv...@li... > Betreff: Re: [Ikvm-developers] Implicit Casting from Int16/Int32 to java.lang.Integer? > > Hi Axel, > > I would recommended to use: > java.lang.Integer.valueOf(1) > > This create not a new Object if the numbers are small. > > > I don’t want to see the C# coder any „java-things“. > There are multiple options. > > If you own the the Java code then you can change the signature or add a new signature like: > public boolean isNumberSpecial(int parameter) { > > If you does not own it then you can do it with a map.xml on compiling the jar to a dll. > > Volker > > > Am 06.06.2013 10:33, schrieb axel stumpp (innoWake gmbh): > Hello, > > i have a question about implicit casting. > > I’ve got a java method which looks like this: > public boolean isNumberSpecial(java.lang.Number parameter) { > blabla; > return true; > } > > Now, when i use this method in the C# environment, i have to use it like this: > If(isNumberSpecial(new java.lang.Integer(1)) > { > } > > Is there a way to omit the „new java Object“ thing like: > If(isNumberSpecial(1) > { > } > > I don’t want to see the C# coder any „java-things“. > > > Greetings, > Axel Stumpp > > > -- > Axel Stumpp > Softwareentwicklung, Beratung > > innoWake gmbh > innovativ | nachhaltig | flexibel > > IT-Tower > Robert-Bosch-Str. 1 | 89250 Senden > Fon: +49.7307.92190.162 > Fax: +49.7307.92190.20 > > axe...@in... > www.innowake.de > > HRB Memmingen 13512 > Geschäftsführer: Thorsten Bernecker, Björn Langmack, Mirko Schliemann > > > This e-mail may contain confidential information. If you are not the intended recipient please notify the sender immediately and destroy this e-mail. > > > > ------------------------------------------------------------------------------ > How ServiceNow helps IT people transform IT departments: > 1. A cloud service to automate IT design, transition and operations > 2. Dashboards that offer high-level views of enterprise services > 3. A single system of record for all IT processes > http://p.sf.net/sfu/servicenow-d2d-j > > > > _______________________________________________ > Ikvm-developers mailing list > Ikv...@li... > https://lists.sourceforge.net/lists/listinfo/ikvm-developers > > ------------------------------------------------------------------------------ > How ServiceNow helps IT people transform IT departments: > 1. A cloud service to automate IT design, transition and operations > 2. Dashboards that offer high-level views of enterprise services > 3. A single system of record for all IT processes > http://p.sf.net/sfu/servicenow-d2d-j_______________________________________________ > Ikvm-developers mailing list > Ikv...@li... > https://lists.sourceforge.net/lists/listinfo/ikvm-developers |