SlideShare a Scribd company logo
Java
Java World, Java Trends, Java 8 and Beyond Olena Syrota
@osyrota
Agenda
▪ Java Today
▪ Java Trends
▪ Java 8
▪ Beyond Java 8
2
Java Today
3
Java Birthday
▪ Started in 1991
▪ Released in 1995
Who of you was born in
1991?
4
5
Java Today - Advantages
▪ Stable
▪ High performance
▪ Backward compatibility
▪ JVM
▪ Mature culture of build tools and practice
▪ JCP process and community involvement
▪ etc
6
Java Today - Disadvantage
▪ A lot of boilerplate code (imperative programming style)
▪ Every language has lambda 
7
Trends
▪ Polyglot development
▪ Languages over JVM (Scala, Groovy, Clojure etc)
▪ Reduce boilerplate code
▪ Java 8 - Lambdas
▪ Maximum using of checking code conditions at compile time
▪ Lambda 8 - Typed annotations
▪ Internet of Things
▪ Java on Raspberry Pi
8
Polyglot Programming
9
Java 8 Released 18 March 2014
▪ 55 new features
in Java SE 8
10
Java SE 8 “Umbrella” Specification
JSR 337
▪ https://www.jcp.org/en/jsr/detail?id=337
▪ Expert Group
▪ Kevin Bourrillion (Google)
▪ Andrew Haley (Red Hat)
▪ Steve Poole (IBM)
▪ Mark Reinhold (Oracle)
11
Java 8
Java for Everyone
• Profiles for constrained devices
• JSR 310 - Date & Time APIs
• Non-Gregorian calendars
• Unicode 6.2
• ResourceBundle.
• BCP47 locale matching
•Globalization &
Accessibility
Innovation
• Lambda aka Closures
• Language Interop
• Nashorn
Core Libraries
• Parallel operations for core
collections APIs
• Improvements in functionality
• Improved type inference
Security
• Limited doPrivilege
• NSA Suite B algorithm support
• SNI Server Side support
• DSA updated to FIPS186-3
• AEAD JSSE CipherSuites
Tools
• Compiler control & logging
• JSR 308 - Annotations on
Java Type
• Native app bundling
• App Store Bundling tools
Client
•Deployment enhancements
•JavaFX 8
•Java SE Embedded support
•Enhanced HTML5 support
•3D shapes and attributes
•Printing
General Goodness
• JVM enhancements
• No PermGen limitations
• Performance lmprovements
12
Java 8
13
Java 8 Features to Discuss
▪ Lambda
▪ Bulk operations for collections
▪ Parallel operations on collections
▪ Date and Time API
▪ Annotations on Types
▪ Nashorn
14
Lambdas
▪ The most significant changes and innovation in Java
▪ Lambda (closures)
▪ Interface evolution (functional interfaces and default methods)
▪ Evolution of Collections library (bulk operations)
▪ Simplified syntax of parallel computation with libraries
15
Lambdas
( ) -> { }
16
Lambda Sample
interface Adder {
int add (int a, int b);
}
Adder adder = (a, b)->a+b;
17
Impact of Lambda
▪ Passing behavior as parameter has great impact on code
▪ Control is transferred from client to library
18
Internal Iteration
public void internalIteration(List<Person> voters) {
voters.forEach(v->System.out.println(v));
}
19
Parallel Internal Iteration
public void internalIteration(List<Person> voters) {
voters.parallelStream().forEach(v->System.out.println(v));
}
20
Bulk Operations on Collections
public static List<Person> eligibleVoters(List<Person> potentialVoters,
int legalAgeOfVoting) {
return potentialVoters
.stream()
.filter(s->s.getAge()>=legalAgeOfVoting)
.collect(Collectors.toList());
}
21
More Bulk Operations
public static double averageAgeOfVoters(List<Person> voters) {
return voters
.stream()
.mapToInt(v->v.getAge())
.average()
.getAsDouble();
}
22
Sequential version
public static Set<Ballot> unspoiledBallots(Set<Ballot> ballots) {
return ballots
.stream()
.filter(b->!b.isSpoiled())
.collect(Collectors.toSet());
}
23
Parallel version
public static Set<Ballot> unspoiledBallots(Set<Ballot> ballots) {
return ballots
.parallelStream()
.filter(b->!b.isSpoiled())
.collect(Collectors.toSet());
}
24
Parallel Computations in Java:
form Thread to Project Lambda
25
Interface Evolution
▪ Functional interfaces
▪ Default methods
26
Interface Evolution
▪ Standard interface Collection has new method forEach
Default method – new feature
of language.
Virtual method can have default
implementation.
This allows to transfer control
over iteration to library.
interface Collection<T> extends Iterable<T> {
default void forEach (Block<T> action) {
for (T t: this) {
action.apply(t);
}
}
}
27
Interface Evolution
Functional interface – allows to
pass behavior as parameter
interface Collection<T> extends Iterable<T> {
default void forEach (Block<T> action) {
for (T t: this) {
action.apply(t);
}
}
}
@FunctionalInterface
interface Block<T> {
void apply(T t);
}
28
Java 8 Added Plenty of New
Features
▪ Java 8 is biggest update to java
programming model
▪ Small set of features, with a big impact
▪ Lambda expressions
▪ Default methods
▪ Bulk operations on collections
▪ Coordinated co-evolution of
▪ language
▪ libraries
▪ APIs
29
Date and Time API
▪ Why new Date and Time API?
▪ Immutable-value classes ( immutable => thread-safe)
▪ Domain-driven API design
30
Date and Time API Sample
public static Period periodBetweenIFormAndLongestDay() {
LocalDate iForumDay = LocalDate.of(2014, 04, 24);
LocalDate longestDay = iForumDay.with(Month.JUNE).withDayOfMonth(22);
return Period.between(longestDay, iForumDay);
}
31
Annotations on Java Types
▪ Before the Java SE 8 release, annotations could only be
applied to declarations (class, constructor, method, field,
local variable, parameter etc.)
▪ As of the Java SE 8 release, annotations can also be
applied to any type use (e.g. generic type arguments, new,
casts, implements, throws)
32
Map<@NonNull String, @NonEmpty List<Document>> files;
myString = (@NonNull String) myObject;
Error Detection at Compile-Time
▪ A compiler plug-in enables a programmer to find bugs or to
verify their absence
▪ E.g. null pointer, immutability etc
33
Checker Framework
34
import org.checkerframework.checker.nullness.qual.NonNull
public class CheckerProof {
public static void main(String[] args) {
String str=null;
proof(str);
}
public static void proof(@NonNull String s) {
System.out.println(s);
}
}
Checker.java:5: error: [argument.type.incompatible] incompatible types in argument.
proof(str);
^
found : @FBCBottom @Nullable String
required: @Initialized @NonNull String
1 error
Nashorn – JavaScript Engine for JVM
▪ You can implement you code in JavaScript
▪ Java seen from Nashorn
▪ Nashorn seen from Java
▪ Applications
▪ Client (Extending FX)
▪ Embedded/Mobile
▪ Server-side scripting
▪ Server-side JavaScript on the JVM with Nashorn (Avatar.js)
35
jjs - command-line tool (JDK)
jjs Hello.js
36
Hello.js:
var hello = function () {
print("Hello Nashorn");
}
hello();
Java seen from Nashorn
37
var HashMap = Java.type('java.util.HashMap');
var map = new HashMap();
map.put('foo', 'foo1');
map.put('bar', 'bar1');
for each(var e in map.keySet()) print(e);
for each(var e in map.values()) print(e);
Nashorn seen from Java
38
import javax.script.*;
public class Nashorn {
public static void main (String[] args) {
ScriptEngineManager m = new ScriptEngineManager();
ScriptEngine e = m.getEngineByName("nashorn");
try {
e.eval("print('hello');"); }
catch (final ScriptException se) {
}
}
}
Java 9 and Beyond
39
Thank you for your attention!
40

More Related Content

What's hot (6)

Whirlwind tour of the Runtime Dynamic Linker
Whirlwind tour of the Runtime Dynamic LinkerWhirlwind tour of the Runtime Dynamic Linker
Whirlwind tour of the Runtime Dynamic Linker
Gonçalo Gomes
 
Airframe RPC
Airframe RPCAirframe RPC
Airframe RPC
Taro L. Saito
 
Kafka y python
Kafka y pythonKafka y python
Kafka y python
Paradigma Digital
 
Trondheim Eclipe Day 2015 and 2016
Trondheim Eclipe Day 2015 and 2016Trondheim Eclipe Day 2015 and 2016
Trondheim Eclipe Day 2015 and 2016
Matthew Gerring
 
SFO15-203: Linaro CI - git driven workflow & Jenkins advanced usage
SFO15-203: Linaro CI - git driven workflow & Jenkins advanced usageSFO15-203: Linaro CI - git driven workflow & Jenkins advanced usage
SFO15-203: Linaro CI - git driven workflow & Jenkins advanced usage
Linaro
 
Clang Analyzer Tool Review
Clang Analyzer Tool ReviewClang Analyzer Tool Review
Clang Analyzer Tool Review
Doug Schuster
 
Whirlwind tour of the Runtime Dynamic Linker
Whirlwind tour of the Runtime Dynamic LinkerWhirlwind tour of the Runtime Dynamic Linker
Whirlwind tour of the Runtime Dynamic Linker
Gonçalo Gomes
 
Trondheim Eclipe Day 2015 and 2016
Trondheim Eclipe Day 2015 and 2016Trondheim Eclipe Day 2015 and 2016
Trondheim Eclipe Day 2015 and 2016
Matthew Gerring
 
SFO15-203: Linaro CI - git driven workflow & Jenkins advanced usage
SFO15-203: Linaro CI - git driven workflow & Jenkins advanced usageSFO15-203: Linaro CI - git driven workflow & Jenkins advanced usage
SFO15-203: Linaro CI - git driven workflow & Jenkins advanced usage
Linaro
 
Clang Analyzer Tool Review
Clang Analyzer Tool ReviewClang Analyzer Tool Review
Clang Analyzer Tool Review
Doug Schuster
 

Viewers also liked (6)

Software Engineering Knowledge Matrix
Software Engineering Knowledge MatrixSoftware Engineering Knowledge Matrix
Software Engineering Knowledge Matrix
Olena Syrota
 
Low-level concurrency (reinvent vehicle)
Low-level concurrency (reinvent vehicle)Low-level concurrency (reinvent vehicle)
Low-level concurrency (reinvent vehicle)
Olena Syrota
 
Trends and future of java
Trends and future of javaTrends and future of java
Trends and future of java
Csaba Toth
 
Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»
Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»
Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»
Anna Shymchenko
 
Hacking Java - Enhancing Java Code at Build or Runtime
Hacking Java - Enhancing Java Code at Build or RuntimeHacking Java - Enhancing Java Code at Build or Runtime
Hacking Java - Enhancing Java Code at Build or Runtime
Sean P. Floyd
 
Type Annotations in Java 8
Type Annotations in Java 8 Type Annotations in Java 8
Type Annotations in Java 8
FinLingua, Inc.
 
Software Engineering Knowledge Matrix
Software Engineering Knowledge MatrixSoftware Engineering Knowledge Matrix
Software Engineering Knowledge Matrix
Olena Syrota
 
Low-level concurrency (reinvent vehicle)
Low-level concurrency (reinvent vehicle)Low-level concurrency (reinvent vehicle)
Low-level concurrency (reinvent vehicle)
Olena Syrota
 
Trends and future of java
Trends and future of javaTrends and future of java
Trends and future of java
Csaba Toth
 
Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»
Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»
Дмитрий Контрерас «Back to the future: the evolution of the Java Type System»
Anna Shymchenko
 
Hacking Java - Enhancing Java Code at Build or Runtime
Hacking Java - Enhancing Java Code at Build or RuntimeHacking Java - Enhancing Java Code at Build or Runtime
Hacking Java - Enhancing Java Code at Build or Runtime
Sean P. Floyd
 
Type Annotations in Java 8
Type Annotations in Java 8 Type Annotations in Java 8
Type Annotations in Java 8
FinLingua, Inc.
 

Similar to Java World, Java Trends, Java 8 and Beyond (iForum - 2014) (20)

Java 8 Lambda
Java 8 LambdaJava 8 Lambda
Java 8 Lambda
François Sarradin
 
What to expect from Java 9
What to expect from Java 9What to expect from Java 9
What to expect from Java 9
Ivan Krylov
 
JDD2015: Java Everywhere Again—with DukeScript - Jaroslav Tulach
JDD2015: Java Everywhere Again—with DukeScript - Jaroslav TulachJDD2015: Java Everywhere Again—with DukeScript - Jaroslav Tulach
JDD2015: Java Everywhere Again—with DukeScript - Jaroslav Tulach
PROIDEA
 
2015 Java update and roadmap, JUG sevilla
2015  Java update and roadmap, JUG sevilla2015  Java update and roadmap, JUG sevilla
2015 Java update and roadmap, JUG sevilla
Trisha Gee
 
De Java 8 a Java 11 y 14
De Java 8 a Java 11 y 14De Java 8 a Java 11 y 14
De Java 8 a Java 11 y 14
Víctor Leonel Orozco López
 
EclipseOMRBuildingBlocks4Polyglot_TURBO18
EclipseOMRBuildingBlocks4Polyglot_TURBO18EclipseOMRBuildingBlocks4Polyglot_TURBO18
EclipseOMRBuildingBlocks4Polyglot_TURBO18
Xiaoli Liang
 
De Java 8 ate Java 14
De Java 8 ate Java 14De Java 8 ate Java 14
De Java 8 ate Java 14
Víctor Leonel Orozco López
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
Speedment, Inc.
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
Malin Weiss
 
Deep Dive into Apache Apex App Development
Deep Dive into Apache Apex App DevelopmentDeep Dive into Apache Apex App Development
Deep Dive into Apache Apex App Development
Apache Apex
 
Java 8
Java 8Java 8
Java 8
Raghda Salah
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and Gaelyk
Guillaume Laforge
 
Java 23 and Beyond - A Roadmap Of Innovations
Java 23 and Beyond - A Roadmap Of InnovationsJava 23 and Beyond - A Roadmap Of Innovations
Java 23 and Beyond - A Roadmap Of Innovations
Ana-Maria Mihalceanu
 
Java user group 2015 02-09-java8
Java user group 2015 02-09-java8Java user group 2015 02-09-java8
Java user group 2015 02-09-java8
marctritschler
 
Java user group 2015 02-09-java8
Java user group 2015 02-09-java8Java user group 2015 02-09-java8
Java user group 2015 02-09-java8
Marc Tritschler
 
New Features in JDK 8
New Features in JDK 8New Features in JDK 8
New Features in JDK 8
Martin Toshev
 
Back to the future with Java 7 (Geekout June/2011)
Back to the future with Java 7 (Geekout June/2011)Back to the future with Java 7 (Geekout June/2011)
Back to the future with Java 7 (Geekout June/2011)
Martijn Verburg
 
New features in jdk8 iti
New features in jdk8 itiNew features in jdk8 iti
New features in jdk8 iti
Ahmed mar3y
 
Java platform
Java platformJava platform
Java platform
Universidade de São Paulo
 
JavaOne_2010
JavaOne_2010JavaOne_2010
JavaOne_2010
Tadaya Tsuyukubo
 
What to expect from Java 9
What to expect from Java 9What to expect from Java 9
What to expect from Java 9
Ivan Krylov
 
JDD2015: Java Everywhere Again—with DukeScript - Jaroslav Tulach
JDD2015: Java Everywhere Again—with DukeScript - Jaroslav TulachJDD2015: Java Everywhere Again—with DukeScript - Jaroslav Tulach
JDD2015: Java Everywhere Again—with DukeScript - Jaroslav Tulach
PROIDEA
 
2015 Java update and roadmap, JUG sevilla
2015  Java update and roadmap, JUG sevilla2015  Java update and roadmap, JUG sevilla
2015 Java update and roadmap, JUG sevilla
Trisha Gee
 
EclipseOMRBuildingBlocks4Polyglot_TURBO18
EclipseOMRBuildingBlocks4Polyglot_TURBO18EclipseOMRBuildingBlocks4Polyglot_TURBO18
EclipseOMRBuildingBlocks4Polyglot_TURBO18
Xiaoli Liang
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
Speedment, Inc.
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
Malin Weiss
 
Deep Dive into Apache Apex App Development
Deep Dive into Apache Apex App DevelopmentDeep Dive into Apache Apex App Development
Deep Dive into Apache Apex App Development
Apache Apex
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and Gaelyk
Guillaume Laforge
 
Java 23 and Beyond - A Roadmap Of Innovations
Java 23 and Beyond - A Roadmap Of InnovationsJava 23 and Beyond - A Roadmap Of Innovations
Java 23 and Beyond - A Roadmap Of Innovations
Ana-Maria Mihalceanu
 
Java user group 2015 02-09-java8
Java user group 2015 02-09-java8Java user group 2015 02-09-java8
Java user group 2015 02-09-java8
marctritschler
 
Java user group 2015 02-09-java8
Java user group 2015 02-09-java8Java user group 2015 02-09-java8
Java user group 2015 02-09-java8
Marc Tritschler
 
New Features in JDK 8
New Features in JDK 8New Features in JDK 8
New Features in JDK 8
Martin Toshev
 
Back to the future with Java 7 (Geekout June/2011)
Back to the future with Java 7 (Geekout June/2011)Back to the future with Java 7 (Geekout June/2011)
Back to the future with Java 7 (Geekout June/2011)
Martijn Verburg
 
New features in jdk8 iti
New features in jdk8 itiNew features in jdk8 iti
New features in jdk8 iti
Ahmed mar3y
 

Recently uploaded (20)

What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 

Java World, Java Trends, Java 8 and Beyond (iForum - 2014)

  • 1. Java Java World, Java Trends, Java 8 and Beyond Olena Syrota @osyrota
  • 2. Agenda ▪ Java Today ▪ Java Trends ▪ Java 8 ▪ Beyond Java 8 2
  • 4. Java Birthday ▪ Started in 1991 ▪ Released in 1995 Who of you was born in 1991? 4
  • 5. 5
  • 6. Java Today - Advantages ▪ Stable ▪ High performance ▪ Backward compatibility ▪ JVM ▪ Mature culture of build tools and practice ▪ JCP process and community involvement ▪ etc 6
  • 7. Java Today - Disadvantage ▪ A lot of boilerplate code (imperative programming style) ▪ Every language has lambda  7
  • 8. Trends ▪ Polyglot development ▪ Languages over JVM (Scala, Groovy, Clojure etc) ▪ Reduce boilerplate code ▪ Java 8 - Lambdas ▪ Maximum using of checking code conditions at compile time ▪ Lambda 8 - Typed annotations ▪ Internet of Things ▪ Java on Raspberry Pi 8
  • 10. Java 8 Released 18 March 2014 ▪ 55 new features in Java SE 8 10
  • 11. Java SE 8 “Umbrella” Specification JSR 337 ▪ https://www.jcp.org/en/jsr/detail?id=337 ▪ Expert Group ▪ Kevin Bourrillion (Google) ▪ Andrew Haley (Red Hat) ▪ Steve Poole (IBM) ▪ Mark Reinhold (Oracle) 11
  • 12. Java 8 Java for Everyone • Profiles for constrained devices • JSR 310 - Date & Time APIs • Non-Gregorian calendars • Unicode 6.2 • ResourceBundle. • BCP47 locale matching •Globalization & Accessibility Innovation • Lambda aka Closures • Language Interop • Nashorn Core Libraries • Parallel operations for core collections APIs • Improvements in functionality • Improved type inference Security • Limited doPrivilege • NSA Suite B algorithm support • SNI Server Side support • DSA updated to FIPS186-3 • AEAD JSSE CipherSuites Tools • Compiler control & logging • JSR 308 - Annotations on Java Type • Native app bundling • App Store Bundling tools Client •Deployment enhancements •JavaFX 8 •Java SE Embedded support •Enhanced HTML5 support •3D shapes and attributes •Printing General Goodness • JVM enhancements • No PermGen limitations • Performance lmprovements 12
  • 14. Java 8 Features to Discuss ▪ Lambda ▪ Bulk operations for collections ▪ Parallel operations on collections ▪ Date and Time API ▪ Annotations on Types ▪ Nashorn 14
  • 15. Lambdas ▪ The most significant changes and innovation in Java ▪ Lambda (closures) ▪ Interface evolution (functional interfaces and default methods) ▪ Evolution of Collections library (bulk operations) ▪ Simplified syntax of parallel computation with libraries 15
  • 16. Lambdas ( ) -> { } 16
  • 17. Lambda Sample interface Adder { int add (int a, int b); } Adder adder = (a, b)->a+b; 17
  • 18. Impact of Lambda ▪ Passing behavior as parameter has great impact on code ▪ Control is transferred from client to library 18
  • 19. Internal Iteration public void internalIteration(List<Person> voters) { voters.forEach(v->System.out.println(v)); } 19
  • 20. Parallel Internal Iteration public void internalIteration(List<Person> voters) { voters.parallelStream().forEach(v->System.out.println(v)); } 20
  • 21. Bulk Operations on Collections public static List<Person> eligibleVoters(List<Person> potentialVoters, int legalAgeOfVoting) { return potentialVoters .stream() .filter(s->s.getAge()>=legalAgeOfVoting) .collect(Collectors.toList()); } 21
  • 22. More Bulk Operations public static double averageAgeOfVoters(List<Person> voters) { return voters .stream() .mapToInt(v->v.getAge()) .average() .getAsDouble(); } 22
  • 23. Sequential version public static Set<Ballot> unspoiledBallots(Set<Ballot> ballots) { return ballots .stream() .filter(b->!b.isSpoiled()) .collect(Collectors.toSet()); } 23
  • 24. Parallel version public static Set<Ballot> unspoiledBallots(Set<Ballot> ballots) { return ballots .parallelStream() .filter(b->!b.isSpoiled()) .collect(Collectors.toSet()); } 24
  • 25. Parallel Computations in Java: form Thread to Project Lambda 25
  • 26. Interface Evolution ▪ Functional interfaces ▪ Default methods 26
  • 27. Interface Evolution ▪ Standard interface Collection has new method forEach Default method – new feature of language. Virtual method can have default implementation. This allows to transfer control over iteration to library. interface Collection<T> extends Iterable<T> { default void forEach (Block<T> action) { for (T t: this) { action.apply(t); } } } 27
  • 28. Interface Evolution Functional interface – allows to pass behavior as parameter interface Collection<T> extends Iterable<T> { default void forEach (Block<T> action) { for (T t: this) { action.apply(t); } } } @FunctionalInterface interface Block<T> { void apply(T t); } 28
  • 29. Java 8 Added Plenty of New Features ▪ Java 8 is biggest update to java programming model ▪ Small set of features, with a big impact ▪ Lambda expressions ▪ Default methods ▪ Bulk operations on collections ▪ Coordinated co-evolution of ▪ language ▪ libraries ▪ APIs 29
  • 30. Date and Time API ▪ Why new Date and Time API? ▪ Immutable-value classes ( immutable => thread-safe) ▪ Domain-driven API design 30
  • 31. Date and Time API Sample public static Period periodBetweenIFormAndLongestDay() { LocalDate iForumDay = LocalDate.of(2014, 04, 24); LocalDate longestDay = iForumDay.with(Month.JUNE).withDayOfMonth(22); return Period.between(longestDay, iForumDay); } 31
  • 32. Annotations on Java Types ▪ Before the Java SE 8 release, annotations could only be applied to declarations (class, constructor, method, field, local variable, parameter etc.) ▪ As of the Java SE 8 release, annotations can also be applied to any type use (e.g. generic type arguments, new, casts, implements, throws) 32 Map<@NonNull String, @NonEmpty List<Document>> files; myString = (@NonNull String) myObject;
  • 33. Error Detection at Compile-Time ▪ A compiler plug-in enables a programmer to find bugs or to verify their absence ▪ E.g. null pointer, immutability etc 33
  • 34. Checker Framework 34 import org.checkerframework.checker.nullness.qual.NonNull public class CheckerProof { public static void main(String[] args) { String str=null; proof(str); } public static void proof(@NonNull String s) { System.out.println(s); } } Checker.java:5: error: [argument.type.incompatible] incompatible types in argument. proof(str); ^ found : @FBCBottom @Nullable String required: @Initialized @NonNull String 1 error
  • 35. Nashorn – JavaScript Engine for JVM ▪ You can implement you code in JavaScript ▪ Java seen from Nashorn ▪ Nashorn seen from Java ▪ Applications ▪ Client (Extending FX) ▪ Embedded/Mobile ▪ Server-side scripting ▪ Server-side JavaScript on the JVM with Nashorn (Avatar.js) 35
  • 36. jjs - command-line tool (JDK) jjs Hello.js 36 Hello.js: var hello = function () { print("Hello Nashorn"); } hello();
  • 37. Java seen from Nashorn 37 var HashMap = Java.type('java.util.HashMap'); var map = new HashMap(); map.put('foo', 'foo1'); map.put('bar', 'bar1'); for each(var e in map.keySet()) print(e); for each(var e in map.values()) print(e);
  • 38. Nashorn seen from Java 38 import javax.script.*; public class Nashorn { public static void main (String[] args) { ScriptEngineManager m = new ScriptEngineManager(); ScriptEngine e = m.getEngineByName("nashorn"); try { e.eval("print('hello');"); } catch (final ScriptException se) { } } }
  • 39. Java 9 and Beyond 39
  • 40. Thank you for your attention! 40