jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukas Kahwe Smith <...@pooteeweet.org>
Subject hash maps was Re: Support for long multivalued properties
Date Fri, 16 Nov 2012 10:39:19 GMT

On Nov 16, 2012, at 11:35 , Alexander Klimetschek <aklimets@adobe.com> wrote:

> On 15.11.2012, at 16:30, Lukas Kahwe Smith <mls@pooteeweet.org> wrote:
>>> Hm, this looks more like node "var" with properties "foo" set to "bar" and "ding"
set to "dong" to me.
>> not really .. the same could be said about any multi valued property otherwise :)
>> i guess hash maps are not a common pattern in Java, but they are quite common in
scripting languages.
> I agree with Felix. Apache Sling has the very nice ValueMap interface [0], which does
exactly that. It's basically a map over the node, writing to properties (and also supporting
deep structures when using "child/one/two/prop" as key).
> Also, one should be careful to not abstract away the JCR from the code and do automatic
DAO mappings or language-construct-to-datastore mappings. Because the repository structure
should live and work independent of a specific programming language, as you might want to
access it with other languages as well.
> [0] http://sling.apache.org/apidocs/sling5/org/apache/sling/api/resource/ValueMap.html

which is the reason why it would be great to add hash maps to JCR. storing hash maps as nodes
with a single property is simple not efficient with an interpreted language where there is
native support for hash maps and where one doesnt have an application server to cache the
node instances in memory across requests.

Lukas Kahwe Smith

View raw message