jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandro Böhme <sandro.boe...@gmx.de>
Subject Re: Jackrabbit Best Practices/Design Patterns (an attempt)
Date Mon, 12 Nov 2007 20:18:51 GMT
Jukka Zitting schrieb:
> Hi,
> On Nov 9, 2007 10:57 PM, Sandro Böhme <sandro.boehme@gmx.de> wrote:
>> Especially in this case a simple
>> NodeIterator "node.getNodesByType(String nodeTypeName)"
>> would be very handy. But as it is not available I would personally
>> favor wrappers for that.
>> Hoping that expert group folks are reading this:
>> I'm just curious, was this usecase already considered by the expert
>> groups and discarded for some reason?
> I wasn't around for JSR 170, so I can't say.
> Personally I tend to prefer using paths for node selection (for
> example have all "songs" as <album>/songs/<song> nodes) and node types
> only for deciding what to do with an already selected node. In my
> experience such late binding works wonders for modularity and
> flexibility.
> Such a design would for example allow you to make no distinction
> between a custom mymusic:Song node and a standard nt:file MP3 node
> uploaded through the standard WebDAV servlet. As long as your
> application  has handlers for both mymusic:Song and nt:file, it can
> simply list everything within ./songs/*. In fact the application
> doesn't even need to have such handlers, but the code that lists the
> songs will still work fine.
> BR,
> Jukka Zitting
Hi Jukka,

this solution is interesting. It clearly shows that one could also solve 
this problem using loose typing and the available API.
Additionally I think it would just be cool if strong typing would also 
be supported with a method along the lines of getNodesByType(nodeTypeName).



View raw message