Question

I have been given a task to create a bridge between C# and Java. It was said that if we use C# right now, and then we receive a Java file from somewhere else, we should be able to convert that Java file into .NET so it can be compatible with our software. The problem is I don't know what to do or how to even begin this task. Any suggestions or advice?

It was said that I initially have to make platform independent classes, if that helps.

*Edit: Sorry if I wasn't clear the first time, because I don't fully understand the task myself, which is why I am here. But from what I understand, I do have to create the bridge itself where I can call the source Java code from my .NET file. I have several months to finish it, so I assume that I have to make every library in Java compatible with C#.

I looked around for help, and found some similar projects: JNBridge(pay to use), Tangible(free demo), and Janett(open source), so that is what I am basing my opinion from.

**Edit: Let's say for example I create a Calculator class in Java. I would want to create the instance of that class in C#.

Was it helpful?

Solution

I have never used this, IKVM.NET may be worth checking out.

IKVM.NET is an implementation of Java for Mono and the Microsoft .NET Framework. It includes the following components:

- A Java Virtual Machine implemented in .NET
- A .NET implementation of the Java class libraries
- Tools that enable Java and .NET interoperability

The one time I've seen it was a while ago, when working with a proprietary .NET based CMS. That assembly was used, but I'm not sure in what capacity.

OTHER TIPS

Depending on the situation, there are a large number of integration technologies that can be used to bridge two systems. In fact, there is an entire software architecture paradigm devoted to this called a Service Oriented Architecture. Any of the techniques used for inter-service communication can be used to integrate any two systems, no matter the size. There are tradeoffs, of course, but there always are.

Without much more information regarding the systems involved and the level of integration needed, it is going to be very hard for a definitive answer to be found for this question.

From your explanation of what you want your bridge to do, it sounds like JNBridge could well solve your problem and save a lot of time reinventing the wheel. If you have any questions, please contact us at JNBridge -- there's a contact link on the website. (Disclosure: Yes, I work for JNBridge.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top