Extension vs defender methods

Henri Gerrits henrigerrits at yahoo.com
Sun Nov 13 05:20:51 PST 2011


How about "addenda methods"?  That would cover both main uses cases: adding to existing interfaces and adding "standard" method implementations to classes as a simple mix-in feature.

Henri




>________________________________
>From: Brian Goetz <brian.goetz at oracle.com>
>To: Zhong Yu <zhong.j.yu at gmail.com>
>Cc: "lambda-dev at openjdk.java.net" <lambda-dev at openjdk.java.net>
>Sent: Saturday, November 12, 2011 3:21 PM
>Subject: Re: Extension vs defender methods
>
>>> As Neal said, English is malleable.  If he wants to define "extension method" method to mean extended by a non-author, that's within the bounds of credibility.  We prefer to think of it as "extended after the fact".
>> 
>> But this feature is also very useful "before the fact"; an interface
>> author can use this feature in version0 of his API.
>
>Indeed it can!  
>
>> If we call it "extension method" we better have a credible explanation
>> of what it is "extending" from. To the lambda team "extension" makes
>> very good sense; but to programmers who see it as a general language
>> feature, "extension" is very perplexing. Can't we have a better name
>> to describe these "interface methods with default implementation"?
>
>One of the other names that has been proposed is "default methods", which I think is a fairly good name.
>
>
>
>
>
>


More information about the lambda-dev mailing list