Jython Goodness With DB4O

I have watched Carl Rosenberger’s talk at ICOODB 2008 in Berlin. You can find it on German Viscuso’s blog. You will notice that he not only talks about LINQ, and LINQ for Java, but he also talks about the possible use of annotations for transactional demarkation.

Separation of Concerns Using Decorators

I was thinking that I could have some fun with DB4O and Jython. If I create a generic object factory to instantiate the Java classes I want to use with DB4O, it would be possible for me to wrap the Java classes in a Python class. This would allow me to decorate method calls to indicate that a method is transactional – basically, by using a Python adapter on a Java class, I could use decorators to separate any one of a number of concerns.

I was thinking that when the object factory produces an object, it would use the generic reflector to populate a dictionary of methods or properties that can be called – basically, the factory would examine the Java object to identify its attributes. For the wrapper/mapper to work, I may have to impose some conventions – the basic idea could be useful and cool.

Remember, the far off goal is something that looks and works like Active Record, but for DB40 using Jython. The programmer would need to know very little about DB4O, but each object would know how to save, update and delete itself, and there would a simply way to dynamically query the repository.

Basically, I think Jython may provide the means to play with syntax, and to toy with various nifty ideas. I will post my next installment in the Formula One tutorial series soon.

Forgive me for blithering – I just want to use my blog entries to record my thoughts where I can.



Leave a Reply