[
https://issues.apache.org/jira/browse/TINKERPOP3-778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14636928#comment-14636928
]
ASF GitHub Bot commented on TINKERPOP3-778:
-------------------------------------------
GitHub user BrynCooke opened a pull request:
https://github.com/apache/incubator-tinkerpop/pull/90
TINKERPOP3-778 Added @GraphFactoryClass annotation
Added @GraphFactoryClass annotation to support locating a factory class
when constructing a graph via GraphFactory.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/BrynCooke/incubator-tinkerpop TINKERPOP3-778
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-tinkerpop/pull/90.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #90
----
commit 9d5826d451a7ad5a70bd3ab3c8a5992f62a9cfbd
Author: Bryn Cooke <[email protected]>
Date: 2015-07-22T13:44:47Z
TINKERPOP3-778 Added @GraphFactoryClass annotation to support locating a
factory class when constructing a graph via GraphFactory.
----
> Support GraphFactory location via annotation.
> ---------------------------------------------
>
> Key: TINKERPOP3-778
> URL: https://issues.apache.org/jira/browse/TINKERPOP3-778
> Project: TinkerPop 3
> Issue Type: Improvement
> Components: structure
> Affects Versions: 3.0.0-incubating
> Reporter: Bryn Cooke
> Assignee: stephen mallette
> Priority: Minor
> Fix For: 3.0.1-incubating
>
>
> When using GraphFactory vendors have to use a concrete class with a static
> 'open' method on it.
> However, I would expect many vendors will want to expose an interface.
> {code:java}
> Map config = new HashMap<>();
> config.put(Graph.GRAPH, MyGraph.class.getName()); //MyGraph is an interface
> MyGraph graph = GraphFactory.open(config);
> {code}
> I realise that class name of the factory needn't match the class that is
> returned to the user, but it would be nice if it did.
> Adding an annotation to specify the factory class would fix this.
> {code:java}
> @GraphFactory(MyGraphFactory.class) //Graph factory uses this to locate the
> graph factory class
> interface MyGraph extends Graph{
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)