jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "angela (JIRA)" <j...@apache.org>
Subject [jira] Updated: (JCR-1405) SPI: Introduce NodeInfo.getChildInfos()
Date Fri, 22 Feb 2008 11:02:20 GMT

     [ https://issues.apache.org/jira/browse/JCR-1405?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

angela updated JCR-1405:

    Attachment: JCR-1405.patch

initial draft for NodeInfo.getChildInfos().

differences compared to the initial suggestion

1) Don't let NodeInfo extend ChildInfo

I looked at this as well. But the only 'overlapping' method that could be
removed from NodeInfo would be 'getIndex()'.
After thinking about it again, i came to the conclusion that 'ChildInfo' actually
has a different meaning that ItemInfo... and eventually it's name is wrong or there would
have been much better ways to solve the issue, that led to ChildInfo. Still what it actually
is from my point of view is: A relative of the NodeId. The problem with NodeId: it may not
reveal the name and the index of a Node and can therefore not be used for hierarchical purposes.

2) Return-Value: Iterator.

For consistency reasons i changed the return value from array to iterator.
All of the following methods (that could be compared to the new one)
- NodeInfo.getPropertyIds
- RepositoryService.getChildInfos
- RepositoryService.getItemInfos
return an Iterator.
While thinking about it, i remembered that we once decided that we'd rather user iterators
for anything that most certainly will contain more than just a couple (more or less limited
amount) of entries.

I adjusted spi-commons, spi2jcr and jcr2spi. It compiles, tests passed but i didn't have time
to really test it or write a reasonable test-case.

(i quickly had a look at the sandbox/spi as well... there it only affected spi2dav and the
modifications were really trivial).

please comment


> SPI: Introduce NodeInfo.getChildInfos()
> ---------------------------------------
>                 Key: JCR-1405
>                 URL: https://issues.apache.org/jira/browse/JCR-1405
>             Project: Jackrabbit
>          Issue Type: New Feature
>          Components: jackrabbit-spi
>            Reporter: angela
>         Attachments: JCR-1405.patch
> Improvement suggested by Marcel:
> ChildInfo is basically a stripped down NodeInfo. With little effort it would even be
possible to have NodeInfo extends ChildInfo. Not sure how useful that is, but since we don't
have that inheritance in code and at the same time nearly a 100% overlap it makes me suspicious.
> Here's another idea:
> introduce a method ChildInfo[] NodeInfo.getChildInfos(). The method either returns:
> - all child infos, which also gives the correct number of child nodes. this may also
mean that an empty array is returned to indicate there are no child nodes.
> - null, to indicate that there are *lots* of child nodes and the method RepositoryService.getChildInfos()
with the iterator should be used. 

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message