I have a query ,i have a project which is done in Java as well as .net.Now my question is wether i can integrate both in java module and .net module in .net.id we can how to do? and what about the performance.
Printable View
I have a query ,i have a project which is done in Java as well as .net.Now my question is wether i can integrate both in java module and .net module in .net.id we can how to do? and what about the performance.
If you want to run Java code on the .NET platform and be able to directly call java functions from .NET you can use http://www.ikvm.net/ performance will be significantly worse than if everything was in java or everything was in .NET. Exactly how much worse it is depends on your app, so the best thing to do is benchmark it and see if it's fast enough.
If you have a .NET app and a Java app, they could also communicate via sockets, webservices, whatever. That may be an option if the two sections are supposed to be stand-alone.
Another option may be to use J#.
For certain situations it is an excellent solution. I would suggest reading the material available at the provided link.
One of the most important considerations in using this is:
So you are locking this aspect of your application into VS-2005, and have 6 years to come up with an alternative....Quote:
Originally Posted by MSDN
J# has nothing to do with OP question. he did not asked that he is expert in java language and want to write a program that already has beent written in Java partly and in .Net Partly from scrath. he asked how to integrate already written code completely in .NET enviroment. so your answer miss lead him.
i am agree with Mutant's answer and i would say that for communicating of two APPs (As mutant stated) we should consider the NBIF and SBIF and both app to do the best integration they may be base on CORBA, XML or even sharing functions via APIs and data VIA popular data bases or even ROW data.
Also Code reuse is good but not always suggested; it depends on the problem.
if in this problem performance hit is a very important issue or integrating two modules mentiond by OP is more consuming that writting from scratch or learning Curve of the current libraaries and existing code is more than writting it or current libraries can be trusted for new solution (as security matter) or main contain bugs that have not been addressed in privious usage then you can offer J#; but wait...why you don't offer C# that has best implementation of .Net framework amongst the othe languages???
Toraj58,
Reading the original post...
Also pay careful attentetion to my statements of:
If I have a completed Java Application/Module and a Completed .NET module, and they need to be integrated (which is completely different than having them communicate ), then compiiling the existing Java code under J# will allow direct calls between the Java code and the .NET code WITHIN the SAME DLL or EXE (but could also be used across multiple DLL's/EXE's)Quote:
Another option may be to use J#. For certain situations it is an excellent solution.
Again, for CERTAIN SITUATIONS this MAY be the most effective way to approach the situation and have a completely integrated (within one executable file) solution.
By no means does this (nor did it ever) imply that it was a general solution.
On the other hand, I have used this technique to speed up communication betwen Java and C# EXISTING code bases by a factor of over 150x faster than CORBA communication.
this was neither OP issue nor mine; Mutant_Fruit brought this issue up. (Reading the Mutant's Post)Quote:
Originally Posted by TheCPUWizard
I brought it up because i wasn't sure what he was asking. Maybe he wanted to link to pre-written GUI apps. In that case sockets or something similar may be a better solution. Maybe not. I don't know any of the background so i just offered all the solutions I could think of.
Your suggestions are all good ones, and are almost certainly appropriate to a much wider range of scenarios than mine. (which is why I did not in any contracdict or challenge them in my original post).
The use-cases for what I proposed are very limited. But if the situation is "right" and the limited support is acceptable, then it does provide benefits that are hard to beat.