Extension vs defender methods

Paul Benedict pbenedict at apache.org
Wed Nov 9 15:55:45 PST 2011


I like this clarification but we better ask the experts who built the
weaver :-) Are the concrete classes that extend List being woven or is the
interface?

Paul

On Wed, Nov 9, 2011 at 3:59 PM, Patrick Wright <pdoubleya at gmail.com> wrote:

> It seems clear to me - a class implementing an interface, say
> ArrayList, is automatically *extended* (via redirection to the default
> implementation) to support new method(s) on List which were not part
> of List's original API. Without a default method provided by the
> mechanism, the class would have to be modified manually. It seems like
> a useful distinction: the class's implementation is being *extended*
> to include implementations it does not provide itself.
>
> The type in question is ArrayList - that is the type that is being
> extended - so we are adding functionality to the class not provided by
> its author.
>
> My interpretation, anyway.
>
>
> Best,
> Patrick
>
>
> > The meaning of extension in the phrase extension methods is that they
> allow
> > functionality to be added (i.e. extend) to a type that was not provided
> by
> > the author of the type.  I don't know in what sense you're using the term
>
>


More information about the lambda-dev mailing list