Sunday, March 15, 2009

Qi4j == Magritte + Traits + OODB + Newspeak

I recently came across the opensource Qi4j project which has Rickard Öberg co-founder of JBoss as one of its core developers. Now I haven't gone into a large amount of detail, but I have read the tutorial and some examples and although I see the benefit, I feel Java as the implementation language was definitely the wrong choice.

If you are going to try predict the future and the best way is to invent it then why cripple it with Java? Ok so thats a little harsh but look at the examples and tell me if you can see the domain code easily, Java is just not expressive/malleable enough to make it read well and Qi4j's meta-descriptions (as annotations) are not extensible or dynamic. In my opinion this limits its power.

Qi4j == Magritte + Traits + OODB + Newspeak

Magritte a meta-description framework, describing domain classes and their respective attributes, relationships and constraints.
With Magritte you can describe your domain model similar to what Qi4j is doing. A major difference is that Magritte is self-describing and the meta-model is modifiable at runtime. So since you can describe your domain you can do things like object persistency, indexing, reports and views etc. and having this meta-model would allow one to create an optimised OODB (ROE?, Gemstone) persistence facility or a relational database mapping scheme (GLORP).

The mixin and behaviour separation constructs in Qi4j remind me of traits which arguably is a better form of behaviour composition.

The Qi4j application 'assembly' steps remind me of Newspeak's nested classes and module system.

I appreciate the ideas that Qi4j is trying to achieve but believe they are most likely wasting lots of developer 'cycles' trying to wrangle Java rather than coming up with some innovative ideas. A dynamic, fully reflective OO lanaguage (like Smalltalk :)) would be better suited to their needs as it would allow them to focus on their 'domain' which is building a DDD enabling framework.

No comments: