incubator-graffito-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christophe Lombart <christophe.lomb...@gmail.com>
Subject OCM - Inheritance & Interface
Date Thu, 09 Feb 2006 20:21:13 GMT
Hi all,

Here is some ideas on the inheritance and interface support for our
JCR mapping framework. In the first time, I'm focusing mainly on the
modification required in the file descriptor.

 :
1/ Inheritance : the class-descriptor can contain a new element
(extent-class) like this :

<class-descriptor class="CmsObjectImpl" jcrName="graffio:cmsobject">
 .....
</class-desciptor>

<class-descriptor class="FolderImpl" jcrName=""graffito:folder >
   <extent-class class-ref = "CmsObjectImpl">
  ...
</class-desciptor>

<class-descriptor class="ContentImpl" jcrName="graffito:content" >
   <extent-class class-ref = "CmsObjectImpl">
   ....
</class-desciptor>

the extent-class is use to make a reference to the "ancestor" class-descriptor.

A query can be done like this :

Filter filter = queryManager.createFilter(CmsObjectImpl.class);
filter.setScope("/test/node1//");
Query query = queryManager.createQuery(filter);
Collection result = persistenceManager.getObjects(query);

the collection result can contain ContentImpl and/or FolderImpl element.
If the JCR query is build with the ancestor node type, it should
work with no many changes in the current code.This solution doesn't
work if the nt:unstructured type is used.

This is just an idea and it needs to be review in more details - what
do you think ?

2/ Interface  : I don't understand why mixin node types should be use.
Java interface have not some attributes. So, I don't see how it can be
set into the JCR node type hierarchy.
I think we can also reuse the extent-class element but more
modification in the current code is required. Still thinking about
that.



--
Best regards,

Christophe

Mime
View raw message