Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9BC9F10974 for ; Sun, 4 Jan 2015 19:27:34 +0000 (UTC) Received: (qmail 61942 invoked by uid 500); 4 Jan 2015 19:27:35 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 61805 invoked by uid 500); 4 Jan 2015 19:27:35 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 61792 invoked by uid 99); 4 Jan 2015 19:27:34 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Jan 2015 19:27:34 +0000 Received: from mail-we0-f174.google.com (mail-we0-f174.google.com [74.125.82.174]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 5FADF1A012A for ; Sun, 4 Jan 2015 19:27:34 +0000 (UTC) Received: by mail-we0-f174.google.com with SMTP id k48so6798738wev.19 for ; Sun, 04 Jan 2015 11:27:33 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.194.8.232 with SMTP id u8mr168040777wja.47.1420399653108; Sun, 04 Jan 2015 11:27:33 -0800 (PST) Received: by 10.194.25.162 with HTTP; Sun, 4 Jan 2015 11:27:33 -0800 (PST) In-Reply-To: <54A98CC9.3060203@gmail.com> References: <20150104170753.6342EAC003F@hades.apache.org> <54A97A55.6020705@gmail.com> <54A98CC9.3060203@gmail.com> Date: Sun, 4 Jan 2015 20:27:33 +0100 Message-ID: Subject: Re: svn commit: r1649362 - /commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/png/scanlinefilters/ From: Benedikt Ritter To: Commons Developers List Content-Type: multipart/alternative; boundary=047d7b5d348cc3fc47050bd890ca --047d7b5d348cc3fc47050bd890ca Content-Type: text/plain; charset=UTF-8 2015-01-04 19:56 GMT+01:00 Thomas Neidhart : > On 01/04/2015 07:48 PM, Benedikt Ritter wrote: > > Hello Thomas, > > > > 2015-01-04 18:37 GMT+01:00 Thomas Neidhart : > > > >> On 01/04/2015 06:07 PM, britter@apache.org wrote: > >>> Author: britter > >>> Date: Sun Jan 4 17:07:51 2015 > >>> New Revision: 1649362 > >>> > >>> URL: http://svn.apache.org/r1649362 > >>> Log: > >>> ScanlineFilter really is an interface > >> > >> there is usually a good reason to use an abstract class instead of an > >> interface in case the type is public. > >> > > > > Yes, if the abstract class has some logic, which subclasses can leverage. > > This was not the case here. > > > > > >> > >> This makes it possible to extend the interface even in minor interfaces. > >> > > > > I don't understand what you mean. Can you give an example? > > If you define a public interface that classes implement, you can not > change the interface during minor releases as this would potentially > break client code. > > Thus there are cases where it is better to use an abstract base class > instead of an interface, especially if it is highly unlikely that > implementing classes will extend or implement other types. > > In math we have several examples of this pattern, as it is much easier > to add new features considering the release policy in commons. > > The pattern is more or less obsolete with java 8, as there you have the > possibility of default methods in interfaces, but as long as the minimum > required version is < java 8 you have to keep this in mind. > > >> > >> Maybe this is not necessary in this case, but should be kept in mind > >> when doing such changes. > >> > > > > As long as an abstract class does not define logic, it doesn't make any > > sense to define it as a class, rather than as an interface. Using > > interfaces has an important advantage: you can only extend one class, but > > can implement more than one interface. So we should really only define > > abstract classes, if they have logic that justifies their existence. > > well it depends on your use-case imho. From a clean object-oriented POV, > you are totally right, but you also have to consider the maintainability > aspect. > I understand your point now. I've never thought about it this way and your right from an "evolving API" POV. Since we're currently designing the 1.0 API, I'd like to leave it this way for now. Or would you rather like to see this commit reverted? Benedikt > > > Benedikt > > > > P.S.: Nice to know, that someone is reviewing my commits in [imaging] :-) > > Usually I am quiet but I read a lot ;-). > > Thomas > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org > > -- http://people.apache.org/~britter/ http://www.systemoutprintln.de/ http://twitter.com/BenediktRitter http://github.com/britter --047d7b5d348cc3fc47050bd890ca--