[dna-issues] [JBoss JIRA] Created: (DNA-265) Improve the Graph API's methods for returning blocks of children
Randall Hauch (JIRA)
jira-events at lists.jboss.org
Fri Dec 12 17:39:36 EST 2008
Improve the Graph API's methods for returning blocks of children
----------------------------------------------------------------
Key: DNA-265
URL: https://jira.jboss.org/jira/browse/DNA-265
Project: DNA
Issue Type: Feature Request
Components: API, Graph
Affects Versions: 0.3
Reporter: Randall Hauch
Assignee: Randall Hauch
Priority: Minor
Fix For: 0.4
The Graph API has several methods for getting a subset (or "block") of children by specifying the parent, starting index, and child. This is useful when a graph client is paging through the children. However, the Graph API methods to do this are less than ideal and don't make for readable code. Plus, there is a use case when the client doesn't want to specify the index, but rather they want to specify the last child that they read. This may be more appealing to some clients for cases when the children are being modified, and the indexes change in between calls to read blocks.
The Graph API should be changed to make getting children more closely aligned with the method to get all children, so that developers can decide after they add the "getChildren()." call, letting the IDE show the different options. Also, the API should supporting getting n children after a previously-retrieved sibling.
Here are some examples of what the new API should look like. This line:
graph.getChildren().of(parent);
gets all children of the 'parent' node (where 'parent' can be a string path, Path, Location, UUID, or identification Property objects). This line:
graph.getChildren().inBlockOf(10).startingAt(50).under(parent);
gets up to 10 children under a parent node, starting at the 51st child (remember, indexes are 0-based). And this line:
graph.getChildren().inBlockOf(10).startingAfter(sibling);
gets up to 10 children that immediately follow the 'sibling' node. Here, 'sibling' can be a string path, Path, Location, UUID, or identification Property objects, but will often be the actual Location returned from a previous call.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the dna-issues
mailing list