views:

146

answers:

4

Hi,

We have an existing C# project based on NHibernate and WPF. I am asked to convert it to Linux and to consider other implementation like Python. But for some reason, they like NHibernate a lot and want to keep it.

Do you know if it's possible to keep the NHibernate stuff and make it work with Python ? I am under the impression that NHibernate is glue code between C# and the DB, so can not be exported to other languages.

Alternative question: can somebody recommend a good python compatible replacement of NHibernate ? The backend DB is Oracle something.

A: 

Check out Django. They have a nice ORM and I believe it has tools to attempt a reverse-engineer from the DB schema.

Josh Pearce
+2  A: 

What about running your project under Mono on Linux? Mono seems to support NHibernate, which means you may be able to get away with out rewriting large chunks of your application.

Also, if you really wanted to get Python in on the action, you could use IronPython along with Mono.

David Wolever
+4  A: 

NHibernate is not specific to C#, but it is specific to .NET.

IronPython is a .NET language from which you could use NHibernate.

.NET and NHibernate can run on Linux through Mono. I'm not sure how good Mono's support is for WPF.

I'm not sure if IronPython runs on Linux, but that would seem to be the closest thing to what you are looking for.

There is a Java version of NHibernate (said tongue in cheek) called Hibernate and there are integration points between Java and Python where Linux is very much supported.

I know the Python community has its own ORMs, but as far as I'm aware, those options are not as mature and feature rich as Hibernate/NHibernate.

I would imagine that almost all of the options available to you would support Oracle.

Michael Maddox
+1, only real anwser to his question.
e-satis
If you switch from NHibernate to Hibernate you could use Jython to code in Python, while using Hibernate (which runs on Java) for database access. The advantage is that java is very much supported on Linux, and Hibernate and NHibernate don't really differ on significant points.
extraneon
While this may be the only real answer to this question, you could probably fit the number of people running the IronPython/Mono/NHibernate stack in a Honda Fit.
Josh Pearce
+1  A: 

SQLAlchemy is the most powerful ORM in Python so far.

Denis Otkidach
Agreed – if you needed a "real" ORM, SA is the only way to go with Python.
David Wolever