Does NHibernate interoperate with Hibernate? If not is there a framework out there for both Java and .NET?

StackOverflow https://stackoverflow.com/questions/1624230

Question

Say you had:

  • a database
  • a bunch of .NET Windows GUI programs
  • a bunch of Java web applications

you could use Hibernate for the Java stuff and NHibernate for the .NET stuff - but would the two actually interoperate or would they be entirely different stacks?

If not then is there a persistence framework out there that lets Java and .NET share business logic?

Was it helpful?

Solution

I can't talk for the Java people, but from the .NET side of things I believe the mapping files could be shared (xml files describing the relationship between database and objects).

Other than that, what would you want to share? Are you thinking business logic? Please define "share logic" a bit further.

You could have your Java people write the persistence code and expose it as RESTful services, then the .NET Windows GUI programmers could just code against that... or vice-versa.

Ultimately there shouldn't be much Hibernate/nHibernate code, since it's job is for you to no longer have to write so much data access code. What's left is application logic with minimal interaction with (n)Hibernate, which will be different depending on your language.

OTHER TIPS

I believe not. nHibernate takes Hibernate as a reference, but they don't actually share code and are developed at different pace. You would have to know the limitations of both.

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