From virtual extension methods to mixins

Brian Goetz brian.goetz at oracle.com
Wed Jul 11 12:12:31 PDT 2012


>> On Monday, July 09, 2012 09:02:41 PM Brian Goetz wrote:
>>> Yes, this is what I call the "virtual field pattern."  It seems perfectly
>>> reasonable to me, because the classes that mix you in have to consent by
>>> providing the {get,set}Peeker methods.  (Also, by the nature of interface
>>> method merging, it addresses the diamond problem as if all base classes
>>> were "virtual".)
>
> "Addresses" in the sense that the choice is taken to use virtual base
> type inheritance in the language, without a trace in the source code.

That choice was embedded in the nature of interfaces in 1996.

> The diamond paradox remains.

Can you elaborate on exactly how you think the Java 8 semantics lead to 
a diamond paradox (with emphasis on the "paradox" part)?



More information about the lambda-dev mailing list