[RDF] Implementation class name style?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[RDF] Implementation class name style?

Stian Soiland-Reyes
[[ I've copied both lists, prefer replies to [hidden email] ]]

What style should we use for packages and class names for the Commons
RDF Term implementations?


To give an example:

http://stain.github.io/incubator-commonsrdf/integration/org/apache/commons/rdf/api/IRI.html

(org.apache.commons.rdf.api.* is pretty-much locked down and agreed by
the incubator project - but I'm thinking of what to call the
implementations here now)


That is the Commons RDF API interface:

org.apache.commons.rdf.api.IRI


is extended by "marker" interfaces per implementation:

org.apache.commons.rdf.jena.JenaIRI
org.apache.commons.rdf.jsonldjava.JsonLdIRI
org.apache.commons.rdf.rdf4j.RDF4JIRI

(adds methods like asJenaNode() to reveal the underlying 'native'
implementations)


and the corresponding implementations which actually wrap the
underlying library's classes:

org.apache.commons.rdf.simple.IRIImpl
org.apache.commons.rdf.jena.impl.IRIImpl
org.apache.commons.rdf.rdf4j.impl.IRIImpl
org.apache.commons.rdf.jsonldjava.JsonLdIRI.JsonLdIRIImpl




for Graph there are quite a few more implementations:

org.apache.commons.rdf.simple.GraphImpl
org.apache.commons.rdf.simple.DatasetGraphView
org.apache.commons.rdf.jsonldjava.JsonLdGraph
org.apache.commons.rdf.jsonldjava.JsonLdUnionGraph
org.apache.commons.rdf.rdf4j.impl.ModelGraphImpl
org.apache.commons.rdf.rdf4j.impl.RepositoryGraphImpl
org.apache.commons.rdf.jena.impl.GraphImpl


but I only made marker interfaces:

org.apache.commons.rdf.jena.JenaGraph
org.apache.commons.rdf.rdf4j.RDF4JGraph



Questions:

a) Should we keep the marker interfaces for RDFTerms (e.g.
jena.JenaIRI) or just have the implementations directly (e.g. as in
simple.IRIImpl)

a2)  Should simple also have a marker interface?  (..they don't have
anything 'inner' to expose)


b) Should we have marker interfaces for the Graph/Dataset
implementations? Here getting access to the underlying model is
probably more important.


c) What style for the implementation class name? E.g. should they all
have the same name like "IRIImpl" (perhaps confusing if you have more
than one module on classpath), or better with prefix, e.g.
"JsonLdIRIImpl"?

d) Where should the implementation live?  sub-package like
org.apache.commons.rdf.jena.impl, or same package as marker interfaces
 -- or as inner class of the marker interface?

(I know - the last sounds nasty - but it's actually quite tidy if we
decide to not make the implementation package-protected, particularly
as most of these marker interfaces are pretty empty :

https://github.com/apache/incubator-commonsrdf/blob/jsonld-java/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdQuad.java
)


e)  How visible should the implementations be, package or public classes?

f) package or public constructors?  They should mostly be possible to
create through the corresponding RDFTermFactory - and 'package' would
mean we could update it in a minor or patch version.

g) - if implementation classes are public - should the implementations
be marked 'final'?

h) how do we construct a package-protected class from the factory
(which is not in .impl)? Jena adds a impl.JenaFactory for this purpose
- but it seems to duplicate most of JenaRDFTermFactory.

https://github.com/apache/incubator-commonsrdf/blob/jena/jena/src/main/java/org/apache/commons/rdf/jena/impl/JenaFactory.java
https://github.com/apache/incubator-commonsrdf/blob/jena/jena/src/main/java/org/apache/commons/rdf/jena/JenaRDFTermFactory.java




Thanks for any suggestions!



--
Stian Soiland-Reyes
http://orcid.org/0000-0001-9842-9718

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [RDF] Implementation class name style?

garydgregory
Hi,

For names, I like CamelCaseEvenForAcronyms, like IbmXmlSaxParser instead of
IBMXMLSAXParser.

Gary

On Mon, Sep 12, 2016 at 5:32 PM, Stian Soiland-Reyes <[hidden email]>
wrote:

> [[ I've copied both lists, prefer replies to [hidden email] ]]
>
> What style should we use for packages and class names for the Commons
> RDF Term implementations?
>
>
> To give an example:
>
> http://stain.github.io/incubator-commonsrdf/integration/org/apache/
> commons/rdf/api/IRI.html
>
> (org.apache.commons.rdf.api.* is pretty-much locked down and agreed by
> the incubator project - but I'm thinking of what to call the
> implementations here now)
>
>
> That is the Commons RDF API interface:
>
> org.apache.commons.rdf.api.IRI
>
>
> is extended by "marker" interfaces per implementation:
>
> org.apache.commons.rdf.jena.JenaIRI
> org.apache.commons.rdf.jsonldjava.JsonLdIRI
> org.apache.commons.rdf.rdf4j.RDF4JIRI
>
> (adds methods like asJenaNode() to reveal the underlying 'native'
> implementations)
>
>
> and the corresponding implementations which actually wrap the
> underlying library's classes:
>
> org.apache.commons.rdf.simple.IRIImpl
> org.apache.commons.rdf.jena.impl.IRIImpl
> org.apache.commons.rdf.rdf4j.impl.IRIImpl
> org.apache.commons.rdf.jsonldjava.JsonLdIRI.JsonLdIRIImpl
>
>
>
>
> for Graph there are quite a few more implementations:
>
> org.apache.commons.rdf.simple.GraphImpl
> org.apache.commons.rdf.simple.DatasetGraphView
> org.apache.commons.rdf.jsonldjava.JsonLdGraph
> org.apache.commons.rdf.jsonldjava.JsonLdUnionGraph
> org.apache.commons.rdf.rdf4j.impl.ModelGraphImpl
> org.apache.commons.rdf.rdf4j.impl.RepositoryGraphImpl
> org.apache.commons.rdf.jena.impl.GraphImpl
>
>
> but I only made marker interfaces:
>
> org.apache.commons.rdf.jena.JenaGraph
> org.apache.commons.rdf.rdf4j.RDF4JGraph
>
>
>
> Questions:
>
> a) Should we keep the marker interfaces for RDFTerms (e.g.
> jena.JenaIRI) or just have the implementations directly (e.g. as in
> simple.IRIImpl)
>
> a2)  Should simple also have a marker interface?  (..they don't have
> anything 'inner' to expose)
>
>
> b) Should we have marker interfaces for the Graph/Dataset
> implementations? Here getting access to the underlying model is
> probably more important.
>
>
> c) What style for the implementation class name? E.g. should they all
> have the same name like "IRIImpl" (perhaps confusing if you have more
> than one module on classpath), or better with prefix, e.g.
> "JsonLdIRIImpl"?
>
> d) Where should the implementation live?  sub-package like
> org.apache.commons.rdf.jena.impl, or same package as marker interfaces
>  -- or as inner class of the marker interface?
>
> (I know - the last sounds nasty - but it's actually quite tidy if we
> decide to not make the implementation package-protected, particularly
> as most of these marker interfaces are pretty empty :
>
> https://github.com/apache/incubator-commonsrdf/blob/
> jsonld-java/jsonld-java/src/main/java/org/apache/commons/
> rdf/jsonldjava/JsonLdQuad.java
> )
>
>
> e)  How visible should the implementations be, package or public classes?
>
> f) package or public constructors?  They should mostly be possible to
> create through the corresponding RDFTermFactory - and 'package' would
> mean we could update it in a minor or patch version.
>
> g) - if implementation classes are public - should the implementations
> be marked 'final'?
>
> h) how do we construct a package-protected class from the factory
> (which is not in .impl)? Jena adds a impl.JenaFactory for this purpose
> - but it seems to duplicate most of JenaRDFTermFactory.
>
> https://github.com/apache/incubator-commonsrdf/blob/
> jena/jena/src/main/java/org/apache/commons/rdf/jena/impl/JenaFactory.java
> https://github.com/apache/incubator-commonsrdf/blob/
> jena/jena/src/main/java/org/apache/commons/rdf/jena/
> JenaRDFTermFactory.java
>
>
>
>
> Thanks for any suggestions!
>
>
>
> --
> Stian Soiland-Reyes
> http://orcid.org/0000-0001-9842-9718
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
E-Mail: [hidden email] | [hidden email]
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory