CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2008
    Posts
    3

    integrating .net and java

    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.

  2. #2
    Join Date
    May 2007
    Posts
    1,546

    Re: integrating .net and java

    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.
    www.monotorrent.com For all your .NET bittorrent needs

    NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.

  3. #3
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: integrating .net and java

    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:
    Quote Originally Posted by MSDN
    Retirement of J# language and Java Language Conversion Assistant from future versions of Visual Studio

    Since customers have told us that the existing J# feature set largely meets their needs and usage of J# is declining, Microsoft is retiring the Visual J# product and Java Language Conversion Assistant tool to better allocate resources for other customer requirements. The J# language and JLCA tool will not be available in future versions of Visual Studio. To preserve existing customer investments in J#, Microsoft will continue to support the J# and JLCA technology that shipped with Visual Studio 2005 through to 2015 as per our product life-cycle strategy. For more information, see Expanded Microsoft Support Lifecycle Policy for Business & Development Products.
    So you are locking this aspect of your application into VS-2005, and have 6 years to come up with an alternative....
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  4. #4
    Join Date
    Mar 2008
    Location
    IRAN
    Posts
    811

    Re: integrating .net and java

    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???
    Last edited by toraj58; January 9th, 2009 at 03:50 PM.
    Please rate my post if it was helpful for you.
    Java, C#, C++, PHP, ASP.NET
    SQL Server, MySQL
    DirectX
    MATH
    Touraj Ebrahimi
    [toraj_e] [at] [yahoo] [dot] [com]

  5. #5
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: integrating .net and java

    Toraj58,

    Reading the original post...


    Quote Originally Posted by arati_reddy08 View Post
    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.
    Also pay careful attentetion to my statements of:
    Another option may be to use J#. For certain situations it is an excellent solution.
    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)

    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.
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  6. #6
    Join Date
    Mar 2008
    Location
    IRAN
    Posts
    811

    Re: integrating .net and java

    Quote Originally Posted by TheCPUWizard
    which is completely different than having them communicate
    this was neither OP issue nor mine; Mutant_Fruit brought this issue up. (Reading the Mutant's Post)
    Please rate my post if it was helpful for you.
    Java, C#, C++, PHP, ASP.NET
    SQL Server, MySQL
    DirectX
    MATH
    Touraj Ebrahimi
    [toraj_e] [at] [yahoo] [dot] [com]

  7. #7
    Join Date
    May 2007
    Posts
    1,546

    Re: integrating .net and java

    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.
    www.monotorrent.com For all your .NET bittorrent needs

    NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.

  8. #8
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: integrating .net and java

    Quote Originally Posted by Mutant_Fruit View Post
    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.
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured