I have applications that have been written in Java, .NET and C++. They all use a common database.
Each app has it's own way of accessing the database, and so things are quite inconsistent.
I was thinking of writing a Data Access Layer using a ORM and having all applications use that.
The question is how to implement this ORM Data Access Layer:
Make a Java package using Hibernate;
use the Java package from the .NET and C++ apps
Make a .NET class library using Entity Framework;
use the class library from the Java apps
In either case, is it easy to access the package/class library from the other platform? Any suggestions on the path to take?
Is communicating via XML between the two platforms the best way?
Ps. I have already seen this question, but I think my question is a super-set of that one.
Ps. Making a web-service is an option, but I would prefer not to write/use a web-service.
This will allow you to share code between .NET and Java. I like most sane people in the world prefer to write data access bits in .NET, but if you've got existing code in Java you want to make available for .NET services this is available
http://www.ikvm.net/
This is the most sane and obviously the quickest way to get up and running. Again, you could use something like Jersey, ASP.NET MVC, NancyFx or whatever REST application server you wanted to get up and running.
I would recommend you use NancyFx and ServiceStack.Text. These are two very simple very pure implementations and are extremely fast, which is what you want if you're using it as a unified DAL on top of your database.
Nancy: https://github.com/NancyFx/Nancy/
ServiceStack.Text: https://github.com/ServiceStack/ServiceStack.Text
Jersey: http://jersey.java.net/
This is actually a viable possibility if you can't use RESTful web services, and also assuming you're exclusively on Windows. This will also be the most troublesome depending on how insane your requirements are. That being said, I've seen this done before and seen it work quite well especially when you have legacy C/C++ components living inside different segments if your infrastructure.
Is communicating via XML between the two platforms the best way?
This will have a performance issue - but will provide a unified data layer in a language independent maner. You can consider the open source WSO2 Data Services Server, if you select to go ahead with this approach...
Thanks...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With