[SCIFIO] Minimal Service Setup for ImgOpener

Mark Hiner hinerm at gmail.com
Wed Sep 25 12:16:32 CDT 2013


Hi Johannes,

How about a warning in the ServiceHelper? It could detect if some service
> whose class' name does not have the org.scijava. prefix but that
> implements SciJavaService...
>

This is a general issue with creating contexts using top-level Service
markers. I would slightly modify Curtis's words along the lines of:

"non-core services should only extend SciJavaService when they serve as a
plug-in to scijava-common functionality"

I would expect this to come up more for SCIFIO extensions. For example, I
made SCIFIO-BF-compat services directly extend SCIFIOService, because even
though they are in a different component, when present on the classpath
they're intended to be integrated with the SCIFIO core.

This allows code like: `new Context(SCIFIOService.class)` to then
automatically load scifio-bf-compat services, when available.

So, conceivably, non-LOCI SCIFIO extensions would want to similarly extend
SCIFIOService, but would have different package prefixes.

Anyway, I think a case could be made for warning when things extend
SciJavaService, but I think there's the chance for such a warning to be
confusing if a case arises where scijava-common functionality is truly
being extended, because doing so isn't strictly wrong.

And if we do add a SciJavaService warning, I don't think we should extend
it to similarly-patterned marker interfaces (SCIFIOService and I think I
made one for IJ2 as well).

- Mark


On Wed, Sep 25, 2013 at 11:50 AM, Johannes Schindelin <
Johannes.Schindelin at gmx.de> wrote:

> Hi Curtis,
>
> On Wed, 25 Sep 2013, Curtis Rueden wrote:
>
> > P.S. The only slightly unintuitive thing (IMHO) is that non-core
> > services should *not* extend SciJavaService, because that interface is
> > intended for use by the org.scijava.* services *only*. (E.g.,
> > SCIFIOService does not extend it.)
>
> How about a warning in the ServiceHelper? It could detect if some service
> whose class' name does not have the org.scijava. prefix but that
> implements SciJavaService...
>
> Ciao,
> Dscho
>
> _______________________________________________
> SCIFIO mailing list
> SCIFIO at scif.io
> http://scif.io/mailman/listinfo/scifio
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://scif.io/pipermail/scifio/attachments/20130925/0ae35c63/attachment-0002.html>


More information about the SCIFIO mailing list