jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boni Gopalan \(BioImagene\)" <Bon...@bioimagene.com>
Subject OCM:To Path or Not to Path
Date Fri, 03 Oct 2008 06:18:46 GMT
While implementing an Abstract DAO layer on top of OCM as part of a data
management system we are building; I came across one issue.  While the
mapping of a Bean to a JcrNode could be specified either through
annotations or through xml mapping; the location in the tree at which
the mapped node should be added need to be specified as an attribute in
a bean (the path attribute).  I do not feel it is robust.  Consider the
case of somebody moving a Hibernate based Dao layer to JCR through OCM.
Suddenly they are hit with the issue of an extra attribute to be added
to the data transfer objects.  Such constraints could make adoption


How I resolved the issue was through a two fold approach.


1.	specify an envelope bean of the following structure to hold the
actual data.



      Object data;

      String path;



2.	Define a naming strategy bean for the system that encapsulates
the path resolution logic.


So, when ever I have to save a new root level node, I resolve the path
(analogous to deciding the table in OR Mapping) through the naming
strategy and then use the envelope bean to persist the data.  The flip
side is that All my root level sppl specific nodes are of the
ocm_type:Envelope :-(.  It works fine; but would be nice to have this
flexibility built into the OCM layer itself.   What I mean  is to have a
notion of root level bean mappings and the resolution of the node names.




Boni Gopalan
Manager Engineering
BioImagene, Pune



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message