jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Parvulescu <alex.parvule...@gmail.com>
Subject Re: AbstractNodeState strange loop
Date Tue, 19 Feb 2013 15:18:45 GMT
I see.

> Dropping one of the default
implementations will force all subclasses to implement that method,
even if they'd have an easier time implementing just the other one.

Dropping the one that I suggested (#getChildNodeEntries) has a really low
footprint as all subclasses have already implemented it.
Future NodeState implementations that extend from ANS need to be aware of
this tiny gem in the code. The least we could do is add a warning in the
javadocs.

best,
alex

On Tue, Feb 19, 2013 at 2:35 PM, Jukka Zitting <jukka.zitting@gmail.com>wrote:

> Hi,
>
> On Tue, Feb 19, 2013 at 3:17 PM, Alex Parvulescu
> <alex.parvulescu@gmail.com> wrote:
> > I came across this funny looking bit in the AbstractNodeState class [0]:
>
> Yeah, that's actually intentional... My goal for ANS was to make it as
> easy as possible to write new draft NodeState implementations without
> worrying about having to implement all the methods right away (at the
> time we were still trying out the concept). As long as you implement a
> few key methods, the ANS base class takes care of the rest, though
> often in a highly inefficient manner. Once you go past initial
> drafting, you'll likely end up implementing all of the methods and
> thus in the end shouldn't be needing ANS anymore except for some odd
> corner cases.
>
> Thus the reason for the circular dependency in
> ANS.getChildNodeNames/Entries is to make it possible to implement
> NodeState either with getChildNodeNames() and getChildNode() or with
> just getChildNodeEntries(), depending on which is more convenient for
> the particular implementation. Dropping one of the default
> implementations will force all subclasses to implement that method,
> even if they'd have an easier time implementing just the other one.
>
> BR,
>
> Jukka Zitting
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message