[ https://issues.apache.org/jira/browse/TINKERPOP-971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15142667#comment-15142667 ]
ASF GitHub Bot commented on TINKERPOP-971: ------------------------------------------ Github user dkuppitz commented on the pull request: https://github.com/apache/incubator-tinkerpop/pull/215#issuecomment-182849111 New code: * https://github.com/apache/incubator-tinkerpop/pull/215/files#diff-61ffd0f149055394746c1d94ccab52e3R65 * https://github.com/apache/incubator-tinkerpop/pull/215/files#diff-bd7750c1c674aeb94e058006af320abfR50 * https://github.com/apache/incubator-tinkerpop/pull/215/files#diff-61f8ab6e66876a272a1fa1f3556b3012R51 * https://github.com/apache/incubator-tinkerpop/pull/215/files#diff-3f79b4cdbc46d5f73ad1864f7d4402a5R80 * https://github.com/apache/incubator-tinkerpop/pull/215/files#diff-34c81b4d45231b961aa8f748f3f4a339R72 * https://github.com/apache/incubator-tinkerpop/pull/215/files#diff-94d7c8c44b3975d2312b04c7f54e500cR47 * https://github.com/apache/incubator-tinkerpop/pull/215/files#diff-b6bca124a8cddd1cd9a8c0b004cd1634R53 Old code, but touched by the commit: * https://github.com/apache/incubator-tinkerpop/pull/215/files#diff-0f4959bc7926d8e5fbd6395e96f19502R76 At least some of these code lines were probably copied from somewhere else as part of the refactoring process. However, as said before, it would probably be better to get rid of `stream()` once we stumble across it in the code we're working on. > TraversalSource should be fluent like GraphComputer > --------------------------------------------------- > > Key: TINKERPOP-971 > URL: https://issues.apache.org/jira/browse/TINKERPOP-971 > Project: TinkerPop > Issue Type: Improvement > Components: process > Affects Versions: 3.1.0-incubating > Reporter: Marko A. Rodriguez > Assignee: Marko A. Rodriguez > Labels: breaking > Fix For: 3.2.0-incubating > > > I just realized something so obvious. {{TraversalSource}} should be fluent > and not this awkward {{TraversalSource.Builder}} model we use. You should be > able to do this: > {code} > graph = GraphFactory.open(...) > g = graph.traversal() > g = g.withStrategy(MyStrategy.class) > g = g.withSack(1.0,sum) > ... > g.V().out().sack() > g.V().out().out().drop() > {code} > Thus, {{TraversalSource}} methods return a {{TraversalSource}}. > {code} > g = > graph.traversal(computer(GiraphGraphComputer)).withStrategy(MyStrategy.class).withSack(1.0,sum).withBulk(false) > {code} > That {{g}} is then "locked" with those parameterizations and any > {{V()}}/{{addV()}}/etc. off of it will spawn traversal with that > parameterization. > This solves: > TINKERPOP3-862 > TINKERPOP3-960 (makes more elegant) > This would be backwards compatible. Though, deprecation would occur. > Finally, DSLs are still respected. > {code} > g = graph.traversal(SocialTraversal.class) > {code} > A fleeting thought... > {code} > g = graph.traversal().using(GiraphGraphComputer) > g = graph.traversal().via(GremlinServerConnection).using(GiraphGraphComputer) > {code} > So much cleaner than all that {{Builder}}-crap.... -- This message was sent by Atlassian JIRA (v6.3.4#6332)