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

Stephan Michels.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to