jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting" <jukka.zitt...@gmail.com>
Subject Re: Jackrabbit Best Practices/Design Patterns (an attempt)
Date Sun, 11 Nov 2007 20:33:08 GMT
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

Mime
View raw message