cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <cziege...@s-und-n.de>
Subject RE: Defining Source Interfaces
Date Wed, 08 Jan 2003 14:45:13 GMT


> -----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


Mime
View raw message