Hi Chris, > From: Mattmann, Chris A (3980) > Sent: February 9, 2016 8:40:06am PST > To: dev@tika.apache.org > Cc: Trevor Claude Lewis; Ramirez, Paul M (398M) > Subject: Re: Use of interface vs. abstract class > > 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.
What's an example of a non-breaking change to the API that's defined by an interface? > So, TL;DR I would prefer interface + abstract base class, but maybe > that’s just me. I'm curious why you prefer an interface (with the breakage issue) plus the need for an abstract base class over just a base class. What I see is people using interfaces when they're pretty certain that (a) implementations will need to support multiple APIs, and (b) the interface won't change. Neither seems the be the case for most of the APIs in Tika. Thanks, -- Ken > 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 >> >> >> >> >> > -------------------------- Ken Krugler +1 530-210-6378 http://www.scaleunlimited.com custom big data solutions & training Hadoop, Cascading, Cassandra & Solr -------------------------- Ken Krugler +1 530-210-6378 http://www.scaleunlimited.com custom big data solutions & training Hadoop, Cascading, Cassandra & Solr