jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting (JIRA)" <j...@apache.org>
Subject [jira] [Created] (OAK-170) Child node state builder
Date Fri, 06 Jul 2012 10:24:33 GMT
Jukka Zitting created OAK-170:
---------------------------------

             Summary: 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

        

Mime
View raw message