Hi!
I finally found some time to accompany my pull request[1] containing the
refactored FactoryRegistry with a formal proposal[2]. These are the main
points:
* FactoryRegistry extends javax.imageio.spi.ServiceRegistry, but on
Java 9 the latter throws an exception if extended by non-JDK
classes; this breaks GeoTools on Java 9.
* Reimplement required ServiceRegistry functionality in
FactoryRegistry, so the latter no longer needs to extend the former.
* Take the opportunity of the resulting runtime incompatibility (has
to do with registration callbacks) to further change the API:
* name new methods according to GeoTools' terminology (e.g.
registerFactory) as opposed to the service registry's
(registerServiceProvider)
* have registry methods return Stream instead of Iterator to
allow clients to use more modern APIs and language features
(note that Stream::iterator makes it easy to switch from
streaming to iterating)
* replace use of javax.imageio.spi.RegisterableService with the
new org.geotools.factory.RegistrableFactory
* replace use of javax.imageio.spi.ServiceRegistry.Filter with
java.util.function.Predicate
The PR[1] implements all of those except for the Stream return type. It
also provides deprecated method variants with the old signature.
Any feedback?
so long ... Nicolai
[1] https://github.com/geotools/geotools/pull/1670
[2]
https://github.com/geotools/geotools/wiki/FactoryRegistry-Refactoring-for-Java-9-Compatibility
--
PGP Key:
http://keys.gnupg.net/pks/lookup?op=vindex&search=0xCA3BAD2E9CCCD509
Web:
http://codefx.org
a blog about software development
https://www.sitepoint.com/java
high-quality Java/JVM content
http://do-foss.de
Free and Open Source Software for the City of Dortmund
Twitter:
https://twitter.com/nipafx
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel