SlideShare ist ein Scribd-Unternehmen logo
1 von 54
Downloaden Sie, um offline zu lesen
Neue Sprachfeatures
λ Lambda-Ausdrücke
Method::References
Method

default methods

≈≈ Streams

@ FunctionalInterfaces
t

Feb. 2002
Java 1.4

•

•
•
•
•
•

Assert
------------Regex
NIO
Logging
JAXP
JAAS/JSSE

Sep. 2004
Java 1.5

•
•
•
•
•

?
Generics
-------------------------Varargs
Compiler API
Foreach Loop
Scripting (JSR223)
JAXB Improvements
Static Imports
JAX-WS
Autoboxing
JVM (Performance,...)
-------------------Java.util.concurrent
•
•

•
•
•
•

•

•

•
•

•

Mär. 2014
Java 1.8

Jul. 2011
Java 1.7

Dez. 2006
Java 1.6

•

•

Switch (Strings)
ARM (try-w-R)
Diamond operator
Multi-Exceptions
Num-Literals
-----------------------NIO2
invokeDynamic

•
•
•
•

•

Lambdas
Method Refs.
Default Meth.
Functional Ifc
Stream
C# 3.0

C# 2.0
Generics

t

Extension Methods,
Lambdas

Nov. 2007

Feb. 2002
Java 1.4

•

•
•
•
•
•

Assert
------------Regex
NIO
Logging
JAXP
JAAS/JSSE

Sep. 2004
Java 1.5

•
•
•
•
•

?
Generics
-------------------------Varargs
Compiler API
Foreach Loop
Scripting (JSR223)
JAXB Improvements
Static Imports
JAX-WS
Autoboxing
JVM (Performance,...)
-------------------Java.util.concurrent
•
•

•
•
•
•

•

•

•
•

•

Mär. 2014
Java 1.8

Jul. 2011
Java 1.7

Dez. 2006
Java 1.6

•

•

Switch (Strings)
ARM (try-w-R)
Diamond operator
Multi-Exceptions
Num-Literals
-----------------------NIO2
invokeDynamic

•
•
•
•

•

Lambdas
Method Refs.
Default Meth.
Functional Ifc
Stream
λ Lambda-Ausdrücke
Method::References
Method

default methods

≈≈ Streams

@ FunctionalInterfaces
(int a, int b) → { return a * b; }
(int a, int b) → a* b
(a, b) → a* b
x→ x*x
interface Callback {
public int doit(int x);
};
java.lang.Runnable
void run()

java.util.concurrent.Callable<V>
V call()

java.awt.event.ActionListener
void actionPerformed(ActionEvent e)

java.beans.PropertyChangeListener
void propertyChange(PropertyChangeEvent evt)

java.io.FileFilter
boolean accept(File pathname)

java.util.Comparator<T>
int compare(T o1, T o2)

javax.naming.spi.ObjectFactory
Object getObjectInstance(.....)
someThing.addCallback(
new Callback() {
public int doit(int x) {
return x *x;
}
});
someThing.addCallback(
new Callback() {
public int doit(int x) {
return x *x;
}
});
someThing.addCallback(
new Callback() {
public int doit(int x) {
return x *x;
}
});
someThing.addCallback(
(int x) → {
return x *x;
}
);
someThing.addCallback(
(int x) → { return x *x; }
);
someThing.addCallback(
(int x) → { return x *x; }
);
someThing.addCallback(
(int x) → x *x
);
someThing.addCallback(
(int x) → x *x
);
someThing.addCallback(
(int x) → x *x
);
someThing.addCallback(
x → x *x
);
someThing.addCallback( x → x *x );
someThing.addCallback(
new Callback() {
public int doit(int x) {
return x *x;
}
});
someThing.addCallback( x → x *x );
(int a, int b) → { return a * b; }
(int a, int b) → a* b;
(a, b) → a* b;
x → x * x;
λ Lambda-Ausdrücke
Method::References
Method

default methods

≈≈ Streams

@ FunctionalInterfaces
some.method(Integer::parseInt);
Statische Methode
someList.forEach(MyClass::instMeth);
someList.forEach( (MyClass e) → e.instMeth() );

Ungebundene Instanz-Methode
some.method(System.out::println);

some.method(instance::instmethod);
Gebundene Instanz-Methode
some.method(MyClass::new);

some.method((x) -> new MyClass(x));
Konstruktor
λ Lambda-Ausdrücke
Method::References
Method

default methods

≈≈ Streams

@ FunctionalInterfaces
List<Point> points = ….
Iterator<Point> it = points.iterator();
while(it.hasNext()) {
Point p = it.next();
….
….
}
List<Point> points = ….
Stream<Point> it = points.stream();
while(it.hasNext()) {
Point p = it.next();
….
….
}
List<Point> points = ….

X

Stream<Point> it = points.stream();

X

while(it.hasNext()) {
Point p = it.next();
….
….
}
List<Point> points = ….
points.stream()
.map(p->p.x)
.filter(v-> v > 0)
.distinct()
.forEach(out::println) ;
Point
Point
Point
Point
Point
Point
Point
Point

map

p → p.x

int
Point
Point
Point
int
Point
Point
Point
filter

int
int
Point
int

v → v>0
distinct

int
Point
foreach

out::println
List<Point> points = ….
points.stream()
.map(p->p.x)
.filter(v-> v > 0)
.distinct()
.forEach(out::println) ;
List<Point> points = ….
points.parallelStream()
.map(p->p.x)
.filter(v-> v > 0)
.distinct()
.forEach(out::println) ;
λ Lambda-Ausdrücke
Method::References
Method

default methods

≈≈ Streams

@ FunctionalInterfaces
interface MyInterface {
public int doit(int x);
static int other(int x){
...some Implementation
}
};
interface MyInterface {
public int doit(int x);
default int other(int x){
...Implementation using this
}
};
λ Lambda-Ausdrücke
Method::References
Method

default methods

≈≈ Streams

@ FunctionalInterfaces
@FunctionalInterface
interface MyInterface {
public int doit(int x);
};
package java.util.function
@FunctionalInterface
interface Function<T, R> {
R apply(T t);
};
package java.util.function
@FunctionalInterface
interface BiFunction<T, U, R> {
R apply(T t, U u);
};
package java.util.function
@FunctionalInterface
interface Consumer<T> {
void accept(T t);
};
package java.util.function
@FunctionalInterface
interface Supplier<T> {
T get();
};
package java.util.function
@FunctionalInterface
interface Predicate<T> {
boolean test(T t);
};
Consumer<Integer> outp =
(i) -> System.out.println(i);
Function<String, Integer> fun =
(s) -> s.length();
Supplier<String> value =
() -> "Hello";
outp.accept(fun.apply(value.get()));
Consumer<Integer> outp =
(i) -> System.out.println(i);
Function<String, Integer> fun =
(s) -> s.length();
Supplier<String> value =
() -> "Hello";
outp ( fun ( value() ) );
λ Lambda-Ausdrücke
Method::References
Method

default methods

≈≈ Streams

@ FunctionalInterfaces
Weiterführendes:
State of the Lambda – Brian Goetz erklärt die Java 8 Features.
http://cr.openjdk.java.net/~briangoetz/lambda/lambda-state-final.html
Lambda – A peek under the hood
http://www.youtube.com/watch?v=C_QbkGU_lqY&noredirect=1
Brian Goetz erklärt, wie Lambdas implementiert sind.
Lambda/Streams Tutorial auf AngelikaLanger.com
http://www.angelikalanger.com/Lambdas/Lambdas.html
Lambda-FAQ von Maurice Naftalin
http://www.lambdafaq.org
Artikel von Angelika Langer und Klaus Kreft in Java Magazin 10.2013 und 11.2013
Java8 complete feature set
http://openjdk.java.net/projects/jdk8/features
Weiterführendes:
Netbeans 7.4
https://netbeans.org/community/releases/74/
Java 8 Early Access
https://jdk8.java.net/download.html
Online Compiler – Try Java 8
http://www.tryjava8.com
Java 8 Lambdas in Action (MEAP)
Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft
http://www.manning.com
forEach( (Aufmerksamkeit) → Vielen Dank )
Dirk Detering ©2013
Version 0.7

Dieses Projekt ist lizensiert als Inhalt der Creative Commons Namensnennung - Nicht-kommerziell Weitergabe unter gleichen Bedingungen 3.0 Deutschland-Lizenz.
Um eine Kopie der Lizenz zu sehen, besuchen Sie http://creativecommons.org/licenses/by-nc-sa/3.0/de/.

Java is a registered trademark of Oracle and/or its affiliates.

Weitere ähnliche Inhalte

Was ist angesagt?

PHP applications/environments monitoring: APM & Pinba
PHP applications/environments monitoring: APM & PinbaPHP applications/environments monitoring: APM & Pinba
PHP applications/environments monitoring: APM & PinbaPatrick Allaert
 
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС2ГИС Технологии
 
Практическое применения Akka Streams
Практическое применения Akka StreamsПрактическое применения Akka Streams
Практическое применения Akka StreamsAlexey Romanchuk
 
Sergi Álvarez & Roi Martín - Radare2 Preview [RootedCON 2010]
Sergi Álvarez & Roi Martín - Radare2 Preview [RootedCON 2010]Sergi Álvarez & Roi Martín - Radare2 Preview [RootedCON 2010]
Sergi Álvarez & Roi Martín - Radare2 Preview [RootedCON 2010]RootedCON
 
Futures e abstração - QCon São Paulo 2015
Futures e abstração - QCon São Paulo 2015Futures e abstração - QCon São Paulo 2015
Futures e abstração - QCon São Paulo 2015Leonardo Borges
 
Javascript Uncommon Programming
Javascript Uncommon ProgrammingJavascript Uncommon Programming
Javascript Uncommon Programmingjeffz
 
Continuation Passing Style and Macros in Clojure - Jan 2012
Continuation Passing Style and Macros in Clojure - Jan 2012Continuation Passing Style and Macros in Clojure - Jan 2012
Continuation Passing Style and Macros in Clojure - Jan 2012Leonardo Borges
 
Numba-compiled Python UDFs for Impala (Impala Meetup 5/20/14)
Numba-compiled Python UDFs for Impala (Impala Meetup 5/20/14)Numba-compiled Python UDFs for Impala (Impala Meetup 5/20/14)
Numba-compiled Python UDFs for Impala (Impala Meetup 5/20/14)Uri Laserson
 
Intro to Reactive Thinking and RxJava 2
Intro to Reactive Thinking and RxJava 2Intro to Reactive Thinking and RxJava 2
Intro to Reactive Thinking and RxJava 2JollyRogers5
 
Operation Flow @ ChicagoRoboto
Operation Flow @ ChicagoRobotoOperation Flow @ ChicagoRoboto
Operation Flow @ ChicagoRobotoSeyed Jafari
 
Scala Turkiye 2013-02-07 Sunumu
Scala Turkiye 2013-02-07 SunumuScala Turkiye 2013-02-07 Sunumu
Scala Turkiye 2013-02-07 SunumuVolkan Yazıcı
 
Transducers in JavaScript
Transducers in JavaScriptTransducers in JavaScript
Transducers in JavaScriptPavel Forkert
 
Get started with Lua - Hackference 2016
Get started with Lua - Hackference 2016Get started with Lua - Hackference 2016
Get started with Lua - Hackference 2016Etiene Dalcol
 
Compiled Python UDFs for Impala
Compiled Python UDFs for ImpalaCompiled Python UDFs for Impala
Compiled Python UDFs for ImpalaCloudera, Inc.
 
AutoDesk
AutoDeskAutoDesk
AutoDeskSE3D
 
Rainer Grimm, “Functional Programming in C++11”
Rainer Grimm, “Functional Programming in C++11”Rainer Grimm, “Functional Programming in C++11”
Rainer Grimm, “Functional Programming in C++11”Platonov Sergey
 

Was ist angesagt? (20)

PHP applications/environments monitoring: APM & Pinba
PHP applications/environments monitoring: APM & PinbaPHP applications/environments monitoring: APM & Pinba
PHP applications/environments monitoring: APM & Pinba
 
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
 
Практическое применения Akka Streams
Практическое применения Akka StreamsПрактическое применения Akka Streams
Практическое применения Akka Streams
 
Sergi Álvarez & Roi Martín - Radare2 Preview [RootedCON 2010]
Sergi Álvarez & Roi Martín - Radare2 Preview [RootedCON 2010]Sergi Álvarez & Roi Martín - Radare2 Preview [RootedCON 2010]
Sergi Álvarez & Roi Martín - Radare2 Preview [RootedCON 2010]
 
Futures e abstração - QCon São Paulo 2015
Futures e abstração - QCon São Paulo 2015Futures e abstração - QCon São Paulo 2015
Futures e abstração - QCon São Paulo 2015
 
Hot Streaming Java
Hot Streaming JavaHot Streaming Java
Hot Streaming Java
 
Hello scala
Hello scalaHello scala
Hello scala
 
Javascript Uncommon Programming
Javascript Uncommon ProgrammingJavascript Uncommon Programming
Javascript Uncommon Programming
 
Continuation Passing Style and Macros in Clojure - Jan 2012
Continuation Passing Style and Macros in Clojure - Jan 2012Continuation Passing Style and Macros in Clojure - Jan 2012
Continuation Passing Style and Macros in Clojure - Jan 2012
 
Numba-compiled Python UDFs for Impala (Impala Meetup 5/20/14)
Numba-compiled Python UDFs for Impala (Impala Meetup 5/20/14)Numba-compiled Python UDFs for Impala (Impala Meetup 5/20/14)
Numba-compiled Python UDFs for Impala (Impala Meetup 5/20/14)
 
Intro to Reactive Thinking and RxJava 2
Intro to Reactive Thinking and RxJava 2Intro to Reactive Thinking and RxJava 2
Intro to Reactive Thinking and RxJava 2
 
Operation Flow @ ChicagoRoboto
Operation Flow @ ChicagoRobotoOperation Flow @ ChicagoRoboto
Operation Flow @ ChicagoRoboto
 
Scala Turkiye 2013-02-07 Sunumu
Scala Turkiye 2013-02-07 SunumuScala Turkiye 2013-02-07 Sunumu
Scala Turkiye 2013-02-07 Sunumu
 
Transducers in JavaScript
Transducers in JavaScriptTransducers in JavaScript
Transducers in JavaScript
 
Get started with Lua - Hackference 2016
Get started with Lua - Hackference 2016Get started with Lua - Hackference 2016
Get started with Lua - Hackference 2016
 
Compiled Python UDFs for Impala
Compiled Python UDFs for ImpalaCompiled Python UDFs for Impala
Compiled Python UDFs for Impala
 
AutoDesk
AutoDeskAutoDesk
AutoDesk
 
x86
x86x86
x86
 
Rainer Grimm, “Functional Programming in C++11”
Rainer Grimm, “Functional Programming in C++11”Rainer Grimm, “Functional Programming in C++11”
Rainer Grimm, “Functional Programming in C++11”
 
Falcom Việt Nam
Falcom Việt NamFalcom Việt Nam
Falcom Việt Nam
 

Ähnlich wie Java8 Neue Sprachfeatures - Lambda/Streams/default Methods/FunctionalInterfaces

Luis Atencio on RxJS
Luis Atencio on RxJSLuis Atencio on RxJS
Luis Atencio on RxJSLuis Atencio
 
Real Time Big Data Management
Real Time Big Data ManagementReal Time Big Data Management
Real Time Big Data ManagementAlbert Bifet
 
New Features in JDK 8
New Features in JDK 8New Features in JDK 8
New Features in JDK 8Martin Toshev
 
Wprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Wprowadzenie do technologii Big Data / Intro to Big Data EcosystemWprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Wprowadzenie do technologii Big Data / Intro to Big Data EcosystemSages
 
Practical RxJava for Android
Practical RxJava for AndroidPractical RxJava for Android
Practical RxJava for AndroidTomáš Kypta
 
Design Summit - Rails 4 Migration - Aaron Patterson
Design Summit - Rails 4 Migration - Aaron PattersonDesign Summit - Rails 4 Migration - Aaron Patterson
Design Summit - Rails 4 Migration - Aaron PattersonManageIQ
 
Reactive cocoa cocoaheadsbe_2014
Reactive cocoa cocoaheadsbe_2014Reactive cocoa cocoaheadsbe_2014
Reactive cocoa cocoaheadsbe_2014Werner Ramaekers
 
Lisp Macros in 20 Minutes (Featuring Clojure)
Lisp Macros in 20 Minutes (Featuring Clojure)Lisp Macros in 20 Minutes (Featuring Clojure)
Lisp Macros in 20 Minutes (Featuring Clojure)Phil Calçado
 
Thumbtack Expertise Days # 5 - Javaz
Thumbtack Expertise Days # 5 - JavazThumbtack Expertise Days # 5 - Javaz
Thumbtack Expertise Days # 5 - JavazAlexey Remnev
 
How to Think in RxJava Before Reacting
How to Think in RxJava Before ReactingHow to Think in RxJava Before Reacting
How to Think in RxJava Before ReactingIndicThreads
 
Rxjava 介紹與 Android 中的 RxJava
Rxjava 介紹與 Android 中的 RxJavaRxjava 介紹與 Android 中的 RxJava
Rxjava 介紹與 Android 中的 RxJavaKros Huang
 
RxJava applied [JavaDay Kyiv 2016]
RxJava applied [JavaDay Kyiv 2016]RxJava applied [JavaDay Kyiv 2016]
RxJava applied [JavaDay Kyiv 2016]Igor Lozynskyi
 
JPoint 2016 - Валеев Тагир - Странности Stream API
JPoint 2016 - Валеев Тагир - Странности Stream APIJPoint 2016 - Валеев Тагир - Странности Stream API
JPoint 2016 - Валеев Тагир - Странности Stream APItvaleev
 
Apache Spark in your likeness - low and high level customization
Apache Spark in your likeness - low and high level customizationApache Spark in your likeness - low and high level customization
Apache Spark in your likeness - low and high level customizationBartosz Konieczny
 
1.5.recommending music with apache spark ml
1.5.recommending music with apache spark ml1.5.recommending music with apache spark ml
1.5.recommending music with apache spark mlleorick lin
 
Meta-objective Lisp @名古屋 Reject 会議
Meta-objective Lisp @名古屋 Reject 会議Meta-objective Lisp @名古屋 Reject 会議
Meta-objective Lisp @名古屋 Reject 会議dico_leque
 

Ähnlich wie Java8 Neue Sprachfeatures - Lambda/Streams/default Methods/FunctionalInterfaces (20)

Luis Atencio on RxJS
Luis Atencio on RxJSLuis Atencio on RxJS
Luis Atencio on RxJS
 
Real Time Big Data Management
Real Time Big Data ManagementReal Time Big Data Management
Real Time Big Data Management
 
New Features in JDK 8
New Features in JDK 8New Features in JDK 8
New Features in JDK 8
 
Wprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Wprowadzenie do technologii Big Data / Intro to Big Data EcosystemWprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
Wprowadzenie do technologii Big Data / Intro to Big Data Ecosystem
 
Practical RxJava for Android
Practical RxJava for AndroidPractical RxJava for Android
Practical RxJava for Android
 
Design Summit - Rails 4 Migration - Aaron Patterson
Design Summit - Rails 4 Migration - Aaron PattersonDesign Summit - Rails 4 Migration - Aaron Patterson
Design Summit - Rails 4 Migration - Aaron Patterson
 
Reactive cocoa cocoaheadsbe_2014
Reactive cocoa cocoaheadsbe_2014Reactive cocoa cocoaheadsbe_2014
Reactive cocoa cocoaheadsbe_2014
 
Lisp Macros in 20 Minutes (Featuring Clojure)
Lisp Macros in 20 Minutes (Featuring Clojure)Lisp Macros in 20 Minutes (Featuring Clojure)
Lisp Macros in 20 Minutes (Featuring Clojure)
 
Solr @ Etsy - Apache Lucene Eurocon
Solr @ Etsy - Apache Lucene EuroconSolr @ Etsy - Apache Lucene Eurocon
Solr @ Etsy - Apache Lucene Eurocon
 
Thumbtack Expertise Days # 5 - Javaz
Thumbtack Expertise Days # 5 - JavazThumbtack Expertise Days # 5 - Javaz
Thumbtack Expertise Days # 5 - Javaz
 
How to Think in RxJava Before Reacting
How to Think in RxJava Before ReactingHow to Think in RxJava Before Reacting
How to Think in RxJava Before Reacting
 
Rxjava 介紹與 Android 中的 RxJava
Rxjava 介紹與 Android 中的 RxJavaRxjava 介紹與 Android 中的 RxJava
Rxjava 介紹與 Android 中的 RxJava
 
RxJava applied [JavaDay Kyiv 2016]
RxJava applied [JavaDay Kyiv 2016]RxJava applied [JavaDay Kyiv 2016]
RxJava applied [JavaDay Kyiv 2016]
 
N flavors of streaming
N flavors of streamingN flavors of streaming
N flavors of streaming
 
Pune Clojure Course Outline
Pune Clojure Course OutlinePune Clojure Course Outline
Pune Clojure Course Outline
 
JPoint 2016 - Валеев Тагир - Странности Stream API
JPoint 2016 - Валеев Тагир - Странности Stream APIJPoint 2016 - Валеев Тагир - Странности Stream API
JPoint 2016 - Валеев Тагир - Странности Stream API
 
Parsec
ParsecParsec
Parsec
 
Apache Spark in your likeness - low and high level customization
Apache Spark in your likeness - low and high level customizationApache Spark in your likeness - low and high level customization
Apache Spark in your likeness - low and high level customization
 
1.5.recommending music with apache spark ml
1.5.recommending music with apache spark ml1.5.recommending music with apache spark ml
1.5.recommending music with apache spark ml
 
Meta-objective Lisp @名古屋 Reject 会議
Meta-objective Lisp @名古屋 Reject 会議Meta-objective Lisp @名古屋 Reject 会議
Meta-objective Lisp @名古屋 Reject 会議
 

Kürzlich hochgeladen

Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 

Kürzlich hochgeladen (20)

Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 

Java8 Neue Sprachfeatures - Lambda/Streams/default Methods/FunctionalInterfaces

Hinweis der Redaktion

  1. Python 1.0 Jan. 94 / 1.5 Jan.98 (Lambda) Ruby 95 ich: Ruby 1.6 Jahr: 2000 (Blocks, Lambda Keyword) Groovy „Closures“ - schlechter Name Scala : Funktionen Umfrage: Wer kennt diese ? Haskell, Erlang, Lisp, Clojure? JavaScript?
  2. AGENDA: KEIN VOLLUMFANG JAVA8 (API, Annotations, Nashorn, JavaFX, VM) KEIN Ersatz für Schulung Keine Einführung in FP Wesentlich: COLLECTIONS als kurzfristiges Ziel. Langfristig: Java ist auf dem Weg zur FUNCTIONAL Language
  3. Grösster Wurf seit (mind.) Java 1.5 Neues Paradigma, Umlernen Java kommt spät!!
  4. C# als „Nachahmung“ hat Java überholt!!
  5. Verschiedene Herangehensweisen: Lambda Calculus (akademisch) Code-as-Data HIER: Syntax und Ableitung von Bisher
  6. Lambda = Anonyme Funktion „Anonyme Methode“ Syntax Vereinfachung Target Typing Noch mehr Vereinfachung
  7. Prototypisches Interface Single Abstract Method (SAM)
  8. SAM Interfaces. Künftig FunctionalInterfaces (Kandidaten) BLOCK SUPPLIER (Lieferanten) CONSUMER (Konsumenten) PREDICATE FUNCTION (Transformation)
  9. „Was bisher geschah ...“
  10. Reduktion um Unnötiges
  11. Formatierung des neuen Lambda-Codes
  12. Reduktion um unnötige Lambda-Syntax IN DIESEM FALL anwendbar
  13. VOILA !! Nochmal der Vorher-Nachher Vergleich:
  14. Closure → Referenz auf Umgebung Effectively Final
  15. Method Handles bereits in Java 7 Zusammenspiel mit invokedynamic Reflektives API ähnlich java.lang.reflection.Method Nun als Syntax verfügbar!!
  16. Syntax: Receiver :: Method
  17. Hier interessant: Instanz kann THIS sein ! =&gt; Lambda compilierbar als private Methode!!
  18. Callable&lt;MyClass&gt;: () =&gt; new MyClass(); Function&lt;T,MyClass&gt; : (e:T):MyClass =&gt; new MyClass(e);
  19. Paket java.util.stream Nicht verwechseln mit java.io.Stream Primäres kurzfristiges Ziel von Projekt Lambda! Wichtigster Anwendungsfall.
  20. Point ist java.awt.Point mit Attributen x und y.
  21. Stream abholen wie Iterator Aber NICHT zur Speicherung und direkten Bearbeitung.....
  22. … sondern Nutzung als Fluent Interface
  23. Point ist java.awt.Point , Attribute x und y. Liste := Punkte mit positiven und negativen Koordinaten , Koordinaten jeweils ggf. doppelt. AUFGABE (aus Lambda-Tour): Finde alle Punkte mit positiven X-Werten und drucke die unterschiedlichen Werte. Streams formen PIPELINE
  24. Streams formen PIPELINE
  25. ACHTUNG: UMSTRUKTURIERUNG DES CODES zur Parallelisierung unter Nutzung des Fork/Join Frameworks.
  26. Einfach parallelStream, um Fork/Join Version zu erhalten.
  27. Aufgekommen durch Notwendigkeit, bestehende Interfaces (Collection) zu erweitern, dann aber auch alle Klassen anpassen zu müssen. Jetzt mehr als nur Notbehelf. Design Mittel Trait in Scala.
  28. This bezieht sich auf Instanz der implementierenden Klasse. Typ von this: MyInterface !
  29. Marker Annotation, ähnlich @Override Nicht notwendig um „Tatsachen zu schaffen“, Compiler prüft auf Einhaltung gewisser Regeln. z.B: nur eine abstrakte Methode
  30. Eigentlich schon ausreichend, um funktionale Programmierung zu ermöglichen.
  31. Zwei Parameter zur Abbildung von Funktionen im Sinne von binären Operationen. Spezialisierung: Operation : BiFunction&lt;T,T,T&gt;
  32. Consumer, nicht pur Funktional. Parametertyp von forEach(..)
  33. Parametertyp von .filter(..) UND: DIVERSE ABARTEN mit Primitiven
  34. Notwendigkeit zum expliziten Aufruf der diversen Methoden.
  35. Möchte man eigentlich so schreiben.
  36. ZUSAMMENFASSUNG NICHT Gezeigt: Methoden von Function (andThen, combine, identity ….) Optional