On 15.11.2012, at 16:30, Lukas Kahwe Smith <[email protected]> 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 Cheers, Alex
