default methods in interfaces

Michael Hixson michael.hixson at gmail.com
Tue Oct 29 02:01:32 PDT 2013


Hello,

Are you asking about the general use cases for mixins and multiple
inheritance?  Or are you saying "Default methods on interfaces in Java
were introduced to support mixins and multiple inheritance.  Why?"

If it's the latter, I would say that is *not* the reason default
methods were added.  Default methods were added to let interfaces grow
without breaking existing code.  And there was a particularly strong
desire to let interfaces grow in this next version of Java due to the
introduction of streams and lambdas.

Brian Goetz wrote some great summaries of the language- and
library-level changes here:

http://cr.openjdk.java.net/~briangoetz/lambda/lambda-state-final.html
http://cr.openjdk.java.net/~briangoetz/lambda/lambda-libraries-final.html

Check out the section "10. Default and static interface methods" in
that first one.

-Michael

On Tue, Oct 29, 2013 at 12:15 AM,  <mohan.radhakrishnan at polarisft.com> wrote:
> Hi,
>          There is no user list and this is a basic question. The default
> methods in interfaces are being used to implement 'MixIn' classes(AspectJ
> does it by weaving classes ) and some references even mention multiple
> inheritance. What is the general design pattern in application code that
> this is intended for ? Is this  related to functional programming styles
> in some way ?
>
> Should I just search older threads for this type of discussion ?
>
> Thanks,
> Mohan
>
>
> This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only.  If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately. You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited.
>
> Visit us at http://www.polarisFT.com
>


More information about the lambda-dev mailing list