[
https://issues.apache.org/jira/browse/OAK-170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13409731#comment-13409731
]
Michael Dürig commented on OAK-170:
-----------------------------------
In OAK-174 I also used this for {{TreeImpl}}. However there is a performance
issue for large child node lists. See OAK-175.
> Child node state builder
> ------------------------
>
> Key: OAK-170
> URL: https://issues.apache.org/jira/browse/OAK-170
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: core
> Reporter: Jukka Zitting
>
> To make it easier to construct and manage complex NodeState changes it's
> currently necessary to explicitly track multiple NodeStates and
> NodeStateBuilders and carefully update each builder all the way to the root
> of the content tree.
> We could simplify this by allowing NodeStateBuilders to be linked to each
> other by a parent-child relationship so that changes to a child builder would
> automatically update also the parent builder.
> A quick draft of how this could look like and behave in the
> {{NodeStateBuilder}} interface is shown below:
> {code:java}
> /**
> * Returns a builder for constructing changes to the named child node.
> * If the named child node does not already exist, a new empty child
> * node is automatically created as the base state of the returned
> * child builder. Otherwise the existing child node state is used
> * as the base state of the returned builder.
> * <p>
> * All updates to the returned child builder will implicitly affect
> * also this builder, as if a
> * <code>setNode(name, childBilder.getNodeState())</code> method call
> * had been made after each update. An explicit
> * {@link #setNode(String, NodeState)}, {@link #removeNode(String)}
> * or another {@link #getChildBuilder(String)} call on this builder
> * will break the link to a possible corresponding previously
> * returned child builder.
> *
> * @since Oak 0.4
> * @param name name of the child node
> * @return child builder
> */
> @Nonnull
> NodeStateBuilder getChildBuilder(String name);
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira