[
https://issues.apache.org/jira/browse/COMMONSRDF-20?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14531837#comment-14531837
]
Stian Soiland-Reyes commented on COMMONSRDF-20:
-----------------------------------------------
On 7 May 2015 at 01:55, Peter Ansell <[email protected]> wrote:
The other issue is that typically instances loaded with ServiceLoader
contain keys that users can use to select their desired implementation based on
some feature that they are looking for.
If they are just aiming to get to any implementations, and they are sure
there is only one on the class path, then ServiceLoader with Iterator.next is
an ideal way to delink them at compile time. It is only when there is more than
one on the classpath that the issue of keys/features needs to be examined.
—
Reply to this email directly or view it on GitHub.
Right, now a factory does not even have a name() or a prescribed toString() -
so it would be a bit difficult to do an informed choice if there is more than
one implementation.
Presumably if you are using the ServiceLoader you don't care too much about
which implementation you get, although you might have an order of preference,
like keep "simple" as the fallback option - but the order of implementations
listed in the ServiceLoader is not something to be relied on.
The implementation guide should probably note that only implementations that
can be "used generally" should list themselves - e.g. a minimal implementation
that doesn't implement createLiteral(String) and createBlankNode() shouldn't
be listed as a ServiceLoader service.
> Provide a mechanism for allowing the load of different RDF Term Factories
> --------------------------------------------------------------------------
>
> Key: COMMONSRDF-20
> URL: https://issues.apache.org/jira/browse/COMMONSRDF-20
> Project: Apache Commons RDF
> Issue Type: New Feature
> Affects Versions: 0.1
> Reporter: Sergio Fernández
> Fix For: 0.2
>
>
> Benedikt has asked this questions in the mailing list:
> http://markmail.org/message/az4jb744zfct2uq5
> What [we currently
> have|http://commonsrdf.incubator.apache.org/userguide.html#Creating_Commons_RDF_instances]
> remains valid, but would be great to make easier the life of people.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)