Hi Alan,
the doc is clearly better.

Can you change
  A service is a single type, usually an interface or abstract class. A 
concrete class can be used, but this is not recommended.
to 
  A service is a single type, usually an interface. An abstract class or a 
concrete class can be used, but this is not recommended.

An abstract class has a constructor so you can observe when a service 
implementation is instantiated by the ServiceLoader, which may make the code 
dependent of the loading order of the service implementations. So using an 
abstract class for a service implementation is also a bad idea.

regards,
Rémi   

----- Mail original -----
> De: "Alan Bateman" <alan.bate...@oracle.com>
> À: "jigsaw-dev" <jigsaw-dev@openjdk.java.net>
> Envoyé: Mardi 20 Juin 2017 12:20:16
> Objet: 8182482: Module System spec updates

> We have two javadoc/spec updates that I'd like to get into the JDK 9
> Initial Release Candidate that is scheduled for this week.
> 
> The spec updates are for two issues:
> 
> 1. ServiceLoader: The API spec has been updated significantly to support
> modules but it needs another round of update to do clean-up to get it
> more readable and consistent, and also to align it with the JLS.  Most
> of reorganization and re-wording has been proposed by Alex. Joe Darcy
> has also proposed a few adjustments.
> 
> 2. Upgradable modules aren't specified anywhere. Java SE will designate
> a number of standard modules as upgradeable but we don't have anywhere
> in the docs to link to that or describe how the upgraded versions are
> used in preference to the modules built into the environment.
> 
> The webrev with the proposed (docs only, no implementation) changes is here:
>   http://cr.openjdk.java.net/~alanb/8182482/webrev/index.html
> 
> The ServiceLoader diffs are hard to read. It might be easier to read the
> generated javadoc:
> http://cr.openjdk.java.net/~alanb/8182482/docs/java/util/ServiceLoader.html
> 
> -Alan

Reply via email to