I was looking at the default object converter (ObjectConverterImpl) and noticed that it dynamically adds the ocm:discriminator mixin type to the jcr node on insert. Additionally I have been thinking about dynamic languages and looking at Freebase, to make a long story short I am thinking about dynamic typing of java objects. My thought was that through a typing (or tagging) mechanism one could create objects with attribute collections whose values could be validated via jcr if one could dynamically assign mixins based on a field in that object.

For example, if you have a vehicle feature you may want to tag it as a transmission and an option. Each tag (or type) would carry a set of attribute definitions that one would want to see on a web page or in a data entry system. If you could inspect the object and look at how it is tagged you could write those tags in as mixins when persisting to jcr. Then jackrabbit could enforce data types, required fields, etc.

This sort of functionality is a no brainer in dynamically typed systems such as javascript, ruby, etc. however is not strictly possible in java (or at least is way out of my league) via interfaces or superclasses, but could be done via a contract (getTags() getTypes() something like that) where a method returns mixin names? Does this make anyone immediately repulsed? I could submit a patch or two to jira if anyone is interested...

-paddy

Reply via email to