Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 15252 invoked by uid 500); 8 Jan 2003 14:50:14 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 15241 invoked from network); 8 Jan 2003 14:50:13 -0000 From: "Carsten Ziegeler" To: Subject: RE: Defining Source Interfaces Date: Wed, 8 Jan 2003 15:45:13 +0100 Message-ID: MIME-Version: 1.0 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 In-Reply-To: Importance: Normal X-MIMETrack: Itemize by SMTP Server on PBSN1/Systeme und Netzwerke(Release 5.0.8 |June 18, 2001) at 08.01.2003 15:50:13, Serialize by Router on PBSN1/Systeme und Netzwerke(Release 5.0.8 |June 18, 2001) at 08.01.2003 15:50:14, Serialize complete at 08.01.2003 15:50:14 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N > -----Original Message----- > From: Stephan Michels [mailto:stephan@apache.org] > Sent: Wednesday, January 08, 2003 3:47 PM > To: cocoon-dev@xml.apache.org > Subject: RE: Defining Source Interfaces > > > > > > > And as far as code cleanliness is concerned, an "instanceof" > test seems > > > more OOP to me than a isTraversable() method that tells us if > is we have > > > the right to use getParent() and getChildren(). With a separate > > > interface, these methods do not exist if they do not make sense. > > > > > This is a point were a not really agree with. If I always have to do > > instanceof tests and class casts, something is wrong with OOP then in my > > eyes. > > I'll hope not ... ;-) > > > fgrep -n "instanceof" > xml-cocoon2/src/java/org/apache/cocoon/components/LifecycleHelper.java > 212: if( component instanceof LogEnabled ) > 240: if( null != context && component instanceof Contextualizable ) > 245: if( null != componentManager && component instanceof > Composable ) > 250: if( null != roles && component instanceof RoleManageable ) > 255: if( null != logkit && component instanceof LogKitManageable ) > 260: if( null != configuration && component instanceof Configurable > ) > 265: if( null != configuration && component instanceof > Parameterizable ) > 271: if( initializeAndStart && component instanceof Initializable ) > 276: if( initializeAndStart && component instanceof Startable ) > 291: if( component instanceof Startable ) > 304: if ( component instanceof Disposable ) > And here is the definitiv answer from the avalon team: "Remember that this is component-oriented programming (COP) and not OOP". :) Carsten --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org