jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Dekany <ddek...@freemail.hu>
Subject Re: Getting "custom" objects from the repository?
Date Mon, 18 Apr 2005 14:29:00 GMT
Monday, April 18, 2005, 3:08:50 PM, Sandro Böhme wrote:

> Hello,
> sorry, but the "poor-man's object-repository-mapping" is already done by
> me ;-) with help of Oliver Kiessler and Christophe Lombart of the 
> Graffito community (both not responsible for the poor part ;-) ).

By risking lynching:

It will be useful whether it will support loading/persisting
"heavyweight objects" (that is my mania, you know, mycms.Template,
org.w3c.dom.Document...), but what do you think about supporting that?
Maybe it could conceptually look like this (simplified for brevity):

                Calls pm.getObject(relPath)
  ... for getting a                    ... for getting a
  lightweight object                   heavyweight object
        |  ^                                |   ^
        |  |                                |   |
---------------------------------------------------------- ORM API
        |  |        _PersistenceManager_    |   |
        |  |                                | /-----\
        |  |Create and initialize           | |Cache|  * See below
        |  |a new instance                  | \-----/
        |  |for each call                   |   |
        V  |                                V   |
---------------------------------------------------------- JCR API
    getNode(),     _JCR implementation_     get
   getProperty()                   jcr:modificaionCounter
                                        and jcr:uuid.

A cache entry should be looked up whose key is the path +
jcr:modificaionCounter + jcr:uuid (the two jcr:... properties were just
read from the JCR). If such cache entry exists, the cached heavyweight
object is returned. Otherwise the same procedure must be done as with
the lightweight objects (all properties read, and the new instance is
made), but in additional the new instance will be added to the cache
(with its path + jcr:modificaionCounter + jcr:uuid as the cache entry

And how could it be decided if something is heavy weight or not? Maybe
based on node type, and/or node path. This could be told to the
PersitanceManager, like "all node inside /articles is heavyweight".

Anyway... just an idea...

Best regards,
 Daniel Dekany

View raw message