DB4O For Scripting Languages

DB4O is not a database, per se, or a database substitute. It is an object persistence tool – or, an object database. An object is more than data. As such, it can help you save, delete, find and update objects that have been created using either Java or a .NET based language. On the .NET side, therefore, it is possible to use DB4O with IronPython or IronRuby – pretty well any language that runs on the CLR. I have not done this myself, and I have to point out that code examples may be in short supply, but it can be done.

Some people might assume that Db4O is more versatile when used under Mone or the .NET framework, but that is not so. The Java community is busy finding ways to make dynamic languages run on under the JVM. Notably, there is Jython, an implementation of Python. There is also JRuby, an implementation of Ruby. I have even read that Ruby on Rails will run under JRuby, which would give RoR developers access to all sort of Java class libraries.

Can you imagine RoR and having access to objects that are being managed by DB4O? In the DB4O forums, the odd person will ask if Db4O will work with PHP, or some other language. The answer should not always be no. I do not have the time right now, but if someone is playing around with these ideas, I would like to here about.

Somebody will get Django to run using IronPython – perhaps even Turbogears. Combining these frameworks with the CLR or the JVM could make it possible to use many other computer languages with DB4O. The door is not closed, but someone needs to make it happen. This is an interesting area. I am interested in using JRuby to run on the JVM, opening the possibility of using DB4O with Ruby on Rails – then, it would be interesting to build a version of Activerecord using DB4O. (Justing thinking out loud.)

Hint: If you use Jython, the key is to inherit from a Java class. If you create an object based on a Python class, it will not persist using DB4O. Good luck.



Leave a Reply