Okay, so I can see where this differs from "traits" or "mixins", as per scala, ruby, smalltalk, simula, fantom, python, etc...
But Java (the language, not VM) seems to be long past the point of innovation. Even closures have been restricted to mere method handles to pacify the more conservative developers in the community. Surely the cutting-edge mantle has now been handed onto Scala, Clojure, et al. On 15 May 2010 13:28, Patrick Wright <[email protected]> wrote: > Brian Goetz mailed the Project Lambda ("closures for jdk 7") mailing > list with a proposal for "virtual extension methods" AKA "defender > methods". > > http://mail.openjdk.java.net/pipermail/lambda-dev/2010-May/001304.html > > PDF with current strawman proposal is > http://cr.openjdk.java.net/~darcy/DefenderMethods.pdf > > "Existing interfaces could be added to without compromising backward > compatibility by adding extension methods to the interface, whose > declaration would contain instructions for finding the default > implementation in the event that implementers do not provide one." > > The idea is roughly that using this, new methods could be added to a > Java interface and could refer to an implementation method in another > class. Any class which implemented version 1 of the interface would > pick up the new method signature from version 2, but if the class > hadn't implemented the new method yet, it would transparently delegate > to the implementation method declared in the interface. > > The PDF is pretty clear and easy to follow, worth a read. > > The best thing about the proposal IMO is the naming: "You could call > these “public defender” methods (or defender methods for short) since > they are akin to the Miranda warning: “if you cannot afford an > implementation of this method, one will be provided for you.” > > > Patrick > > -- > You received this message because you are subscribed to the Google Groups > "The Java Posse" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<javaposse%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/javaposse?hl=en. > > -- Kevin Wright mail/google talk: [email protected] wave: [email protected] skype: kev.lee.wright twitter: @thecoda -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
