Hey Ken, My general preference in these situations is to use an interface; then to provide an abstract base class, and encourage some limited method implementation and basic functionality to bubble up into the abstract base class that implements that interface. Then we can encourage non-API changes to the abstract base class; API (possibly but not guaranteed to be breaking) changes to the interface, and so forth.
So, TL;DR I would prefer interface + abstract base class, but maybe that’s just me. Cheers, Chris CC/Trevor - FYI Trevor, please talk to Ken since he is working on what I had assigned you to do as well - aka the LanguageIdentifier refactor/interface. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Chris Mattmann, Ph.D. Chief Architect Instrument Software and Science Data Systems Section (398) NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA Office: 168-519, Mailstop: 168-527 Email: chris.a.mattm...@nasa.gov WWW: http://sunset.usc.edu/~mattmann/ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Adjunct Associate Professor, Computer Science Department University of Southern California, Los Angeles, CA 90089 USA ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -----Original Message----- From: Ken Krugler <kkrugler_li...@transpac.com> Reply-To: "dev@tika.apache.org" <dev@tika.apache.org> Date: Tuesday, February 9, 2016 at 8:34 AM To: "tika-...@lucene.apache.org" <tika-...@lucene.apache.org> Subject: Use of interface vs. abstract class >Hi all, > >In general I see open source projects using abstract classes for >extension points, as that provides for a migration path in the event of >an API change, versus breaking any code that has implemented the >interface. > >I see some interfaces being used in Tika, e.g. Translator. > >Does the ServiceLoader require that these be interfaces? I assume not, as >isAssignableFrom() should work with either interfaces or abstract >classes, right? > >Asking because I'm looking at the language detector API for 2.x. > >Thanks, > >-- Ken > > > >-------------------------- >Ken Krugler >+1 530-210-6378 >http://www.scaleunlimited.com >custom big data solutions & training >Hadoop, Cascading, Cassandra & Solr > > > > >