add-memberalign-toparrow-leftarrow-rightbellblockcalendarcamerachatchevron-leftchevron-rightchevron-small-downchevron-upcircle-with-crosscomposecrossfacebookflagfolderglobegoogleimagesinstagramkeylocation-pinmedalmoremuplabelShape 3 + Rectangle 1pagepersonpluspollsImported LayersImported LayersImported LayersshieldstartwitterwinbackClosewinbackCompletewinbackDiscountyahoo

Re: [ljc] Re: Defender Methods

From: Kevin W.
Sent on: Wednesday, August 8, 2012 9:06 AM
That's essentially the solution that Scala adopted when implementing traits.

The catch is, you're then in a position that multiple inheritance becomes possible, and the dreaded "diamond inheritance" problem along with it.  This is exactly the sort of thing that Java sought to eliminate with interfaces in the first place!

Scala solves the conundrum through an technique known as linearisation, which then also begs for self-typing to make it a complete solution.  By this stage, we've already gone quite some distance beyond the remit of defender methods...

On 8 August[masked]:20, Alex Anderson <[address removed]> wrote:
It's a shame there's not a third option in the survey - if a method
body is declared in an interface, then surely it could be understood
implicitly to be a default implementation?

Our Sponsors

  • Our Blog

    Read the latest news from the LJC

  • RecWorks Ltd

    Fixing Tech Recruitment using the Power of Community

  • jClarity

    Java/JVM Performance Analysis Tools & mentoring for Java related matters

  • LJC Aggrity

    Our LJC Aggrity site contains blog posts from our members

  • LJC Book Club

    Our Book club with book reviews from our members

  • Devoxx UK

    Java Community Conference, in collaboration with the LJC 12/13 Jun 14

  • SkillsMatter

    "Host, help organise, promote, film many of our meetings."

  • IBM

    Build Enterprise-grade apps at start-up speed.

  • New Relic

    New Relic makes sense of billions of metrics a day in real time.

  • Hazelcast

    Hazelcast is the leader in operating in-memory computing.

  • Java.Net

    We are an official Java User Group recognised by Oracle's JUG program

  • JRebel

    Free 3 month J-Rebel license.

  • O'Reilly

    40% discount on printed books and 50% on e-books.

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy