Extension vs defender methods
Patrick Wright
pdoubleya at gmail.com
Wed Nov 9 13:59:17 PST 2011
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