Hello Bertrand, On Mon, Nov 16, 2009 at 10:15 PM, Bertrand Delacretaz <[email protected]> wrote: > Hi Ard, > > On Mon, Nov 16, 2009 at 2:39 PM, Ard Schrijvers > <[email protected]> wrote: >> ...Just wondering: where does jackrabbit-ocm fit in then? I do not have >> that much experience with it, but it feels like JCR-to-object to me. >> Only use it when your really really have to :-)))?... > > Actually...yes and no. > > After rereading this thread I'd say something like "if you're coming > from a relational world where object-to-DB mapping is the norm, think > twice before using it in the JCR world. You might not need it, as the > JCR API is much closer to what you need at the content application > level".
I do not agree, and fortunately, mapping jcr nodes to simple java objects which again can be accessed from jsp / freemarker / velocity scripts feels much more natural to me, is quite easy: I do not want to burden other developers with handling all the jcr stuff, catching all the exceptions, handling defaults, writing complex queries (do you really like to write search queries? It is part of the JCR API, but I am glad I went through all that once, and made a simple java interface for it (similar to jr-ocm, only targeted for large repositories avoiding slow queries, and supporting more website convenient searches, like multiple scoped kind of queries). Anyways, I think it is just a matter of taste. I mainly just do not agree to add it to David's rules to avoid jcr-to-object. I encourage developers to avoid direct jcr calls in our environment :-)) Regards Ard > -Bertrand >
