Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 41762 invoked from network); 2 Feb 2005 02:04:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 2 Feb 2005 02:04:56 -0000 Received: (qmail 41778 invoked by uid 500); 2 Feb 2005 02:04:53 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 41708 invoked by uid 500); 2 Feb 2005 02:04:53 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 41695 invoked by uid 99); 2 Feb 2005 02:04:53 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mail62.messagelabs.com (HELO mail62.messagelabs.com) (203.166.119.147) by apache.org (qpsmtpd/0.28) with SMTP; Tue, 01 Feb 2005 18:04:52 -0800 X-VirusChecked: Checked X-Env-Sender: Colin.sharples@contact-energy.co.nz X-Msg-Ref: server-8.tower-62.messagelabs.com!1107309886!26701065!2 X-StarScan-Version: 5.4.8; banners=-,-,- X-Originating-IP: [202.135.38.66] Received: (qmail 369 invoked from network); 2 Feb 2005 02:04:47 -0000 Received: from wlg-mail.contact-energy.co.nz (202.135.38.66) by server-8.tower-62.messagelabs.com with SMTP; 2 Feb 2005 02:04:47 -0000 Received: from WLG-MAIL.contact-energy.co.nz ([192.168.183.66]) by wlg-mail.contact-energy.co.nz (SAVSMTP 3.1.1.32) with SMTP id M2005020115060519184 for ; Tue, 01 Feb 2005 15:06:05 -1100 Received: from WLG-EVS.contact-energy.co.nz ([192.168.152.33]) by WLG-MAIL.contact-energy.co.nz with Microsoft SMTPSVC(5.0.2195.6713); Wed, 2 Feb 2005 15:06:05 +1300 X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [digester] initial code for Digester2.0 Date: Wed, 2 Feb 2005 15:04:46 +1300 Message-ID: <5F08B760C43F824AB2F061D146EC842502B6A0E3@WLG-EVS.contact-energy.co.nz> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [digester] initial code for Digester2.0 Thread-Index: AcUIx/5t3jp3DrXqQHORInzwo46A6AAAIMNQ From: "Sharples, Colin" To: "Jakarta Commons Developers List" X-OriginalArrivalTime: 02 Feb 2005 02:06:05.0769 (UTC) FILETIME=[C0E73B90:01C508CB] X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N > > - Why is Action an abstract class? >=20 > So that we can later add new functionality to Action without breaking > custom Action subclasses that users have written. As long as we can > provide a suitable default implementation in the Action=20 > abstract class, > everything runs smoothly. >=20 > One example is the "bodySegment" callback that is now in Action. In > Digester 1.x we could not have added this to Rule without breaking all > custom Rule classes. But if digester2.0 had been released=20 > without it, we > could have added it later with no source or binary compatibility > problems. >=20 > Of course because of Java's single-inheritance policy, it would be > impossible for a class to extend both Action and some other class. But > (a) this is extremely unlikely, and (b) using an "adapter" class works > around this anyway if it absolutely has to be done. I prefer interface + default abstract implementation, the way Swing = provides e.g. Action* and AbstractAction. That way a class can still = implement the interface even if it extends from something else, and use = a delegate to implement the interface. You can still evolve the = interface without breaking existing classes that extend the abstract = class. Of course, there is nothing to force people to extend the = abstract class, but you can make it clear in the doco for the interface = that not to extend the abstract class is an explicit design choice that = may have dire consequences. * yes, the name Action is quite overused. Not that I can think of a = better alternative... ;-) Colin Sharples IBM Advisory IT Specialist Email: sharples@nz.ibm.com Mobile: +64 21 402 085 --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org