cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <nicola...@apache.org>
Subject Re: defaulting to a matcher when another one is not present
Date Thu, 10 Oct 2002 07:05:41 GMT


Hunsberger, Peter wrote:
>>>If you think that point 2) is valid, let me ask you; do you ever use
>>>inheritance in Java?  Do you ever use inheritance where you only want to
>>>override part of the behavior of the super class but otherwise let the
>>
> rest
> 
>>>of the processing continue on as normal?
>>
>>Usually I never do this, I use composition, not inheritance.
>>
>>I have never found the need to inherit from a non-abstract class yet, so 
>>you can understand why I don't see the need.
>>Invert the selection logic, put it in the parent, not the child.
> 
> Umm, forgot to comment on this: if I invoke another classes methods I'm
> certainly free to deal with any exception as I see fit? It seems to me that
> a sitemap doesn't implement the equivalent of composition either...

A sitemap is not a class either, it doesn't have methods.
The analogy is not 1-1, but the concept remains: inheritance would mean 
I get all the matchers of the supersitemap plus mine and eventually 
substitute then, while composition means I can compose subsitemaps in a 
parent sitemap and make them handle part of the URI space.

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message