{"action":"created","issue":{"url":"https://api.github.com/repos/tinkerpop/tinkerpop3/issues/477","labels_url":"https://api.github.com/repos/tinkerpop/tinkerpop3/issues/477/labels{/name}","comments_url":"https://api.github.com/repos/tinkerpop/tinkerpop3/issues/477/comments","events_url":"https://api.github.com/repos/tinkerpop/tinkerpop3/issues/477/events","html_url":"https://github.com/tinkerpop/tinkerpop3/issues/477","id":54299757,"number":477,"title":"Simplify the GraphStrategy interface","user":{"login":"BrynCooke","id":747836,"avatar_url":"https://avatars.githubusercontent.com/u/747836?v=3","gravatar_id":"","url":"https://api.github.com/users/BrynCooke","html_url":"https://github.com/BrynCooke","followers_url":"https://api.github.com/users/BrynCooke/followers","following_url":"https://api.github.com/users/BrynCooke/following{/other_user}","gists_url":"https://api.github.com/users/BrynCooke/gists{/gist_id}","starred_url":"https://api.github.com/users/BrynCooke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrynCooke/subscriptions","organizations_url":"https://api.github.com/users/BrynCooke/orgs","repos_url":"https://api.github.com/users/BrynCooke/repos","events_url":"https://api.github.com/users/BrynCooke/events{/privacy}","received_events_url":"https://api.github.com/users/BrynCooke/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tinkerpop/tinkerpop3/labels/enhancement","name":"enhancement","color":"009800"},{"url":"https://api.github.com/repos/tinkerpop/tinkerpop3/labels/structure","name":"structure","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-01-14T09:19:33Z","updated_at":"2015-01-31T21:13:13Z","closed_at":null,"body":"Currently GraphStrategy feels too complicated.\r\n\r\nIt's because it looks like the formal parameters that should be on the method have been shifted on to the return type.\r\n```\r\n\tpublic UnaryOperator<BiFunction<Direction, String[], Iterator<Vertex>>> getVertexIteratorsVerticesStrategy(\r\n\t\t\tContext<StrategyWrappedVertex> ctx) {\r\nreturn lambda crazyness;\r\n}\r\n```\r\nvs\r\n```\r\n\tpublic Iterator<Vertex> getVertexIteratorsVertices(\r\n\t\t\tContext<StrategyWrappedVertex> ctx, Direction direction, String[] params) {\r\nreturn an iterator;\r\n}\r\n```\r\n\r\nThe first example is difficult to document using javadocs and IDEs won't give much assistance to the user. The second example @param can be used for documentation.\r\n\r\nIf the default implementation must be dynamic then the result could be retained within the context:\r\n```\r\n\tpublic void onVertexIteratorsVertices(\r\n\t\t\tContext<StrategyWrappedVertex, Iterator<Vertex>> ctx, Direction direction, String[] params) {\r\nctx.setResult(iterator); //Setting the result indicates that this event has been handled an default processing should not take place.\r\n}\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/tinkerpop/tinkerpop3/issues/comments/72336941","html_url":"https://github.com/tinkerpop/tinkerpop3/issues/477#issuecomment-72336941","issue_url":"https://api.github.com/repos/tinkerpop/tinkerpop3/issues/477","id":72336941,"user":{"login":"BrynCooke","id":747836,"avatar_url":"https://avatars.githubusercontent.com/u/747836?v=3","gravatar_id":"","url":"https://api.github.com/users/BrynCooke","html_url":"https://github.com/BrynCooke","followers_url":"https://api.github.com/users/BrynCooke/followers","following_url":"https://api.github.com/users/BrynCooke/following{/other_user}","gists_url":"https://api.github.com/users/BrynCooke/gists{/gist_id}","starred_url":"https://api.github.com/users/BrynCooke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrynCooke/subscriptions","organizations_url":"https://api.github.com/users/BrynCooke/orgs","repos_url":"https://api.github.com/users/BrynCooke/repos","events_url":"https://api.github.com/users/BrynCooke/events{/privacy}","received_events_url":"https://api.github.com/users/BrynCooke/received_events","type":"User","site_admin":false},"created_at":"2015-01-31T21:13:13Z","updated_at":"2015-01-31T21:13:13Z","body":"@davidcrouch\r\nI haven't looked in detail. But as a java dev I would feel much more comfortable with this sort of API."}}