Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Eclipse and Java 8 - GHC Poster

Noopur
November 16, 2013

Eclipse and Java 8 - GHC Poster

Poster presented on "Eclipse and Java 8" at the Grace Hopper Celebration of Women in Computing India (Bangalore) 2013 (a program of the Anita Borg Institute, co-presented with the Association for Computing Machinery).

Noopur

November 16, 2013
Tweet

More Decks by Noopur

Other Decks in Programming

Transcript

  1. Join the Eclipse open source community and its large ecosystem

    of projects: http://www.eclipse.org/ - Forums: http://www.eclipse.org/forums - Bugzilla: http://bugs.eclipse.org/bugs/ - Contributing to JDT/UI: http://wiki.eclipse.org/JDT_UI/How_to_Contribute Noopur Gupta ([email protected]) Eclipse JDT/UI Committer IBM Software Lab, Bangalore Project Lambda - Problem: A lambda expression that just invokes a named method. - Solution: Further simplify the implementation of functional interface by using a shorthand for lambda – method reference of the existing named method. - Interfaces that define a single abstract method. - Optionally capture the design intent with @FunctionalInterface annotation. - Example: Common callback interfaces like Runnable and Comparator. Functional Interfaces Method References - A lambda expression is used to implement a functional interface, without creating a class or an anonymous class. - Problem: “Tiny anonymous classes” used in callbacks, runnables, event handlers, comparators etc. - Solution: Reduced runtime overhead compared to anonymous classes! - Syntax: Concise syntax compared to anonymous classes! All we need! Lambda Expression! (formal parameter list) { expression or statements } Lambda Expressions - Problem: Evolve interfaces without introducing incompatibility with existing implementations.  Standard Java libraries need new lambda-friendly methods. - Solution: Default methods – means of API evolution - Problem: A common scenario – Java libraries having companion utility classes with static methods. - Solution: Static methods – allow helper methods specific to an interface to live with the interface. Default Methods Static Methods Type Annotations - Before Java 8: Annotations could only be applied to declarations. - As of Java 8: Annotations can also be applied anywhere you use a type! Supports improved analysis of Java programs. Enables checker frameworks and static analysis tools such as Sonar and FindBugs. - In Java 8, it is permitted to explicitly declare the method receiver as the first formal parameter. The only purpose of writing the receiver explicitly is to make it possible to annotate the receiver’s type. Declaration Annotation Type Use Annotation Project Lambda – Interface Improvements Eclipse is a free and open source development platform comprising of extensible frameworks, tools and runtimes. The Eclipse Java development tools (JDT) project contributes an extensible full-featured Java IDE to the Eclipse platform. It is considered by many to be the best Java development tool available. The next iteration of the Java language i.e. Java 8 is currently scheduled for general availability in March 2014. JDT will provide a feature patch for Eclipse Kepler SR2 (4.3.2) and ship Java 8 support with the next Eclipse release i.e. Eclipse Luna (4.4).