SlideShare a Scribd company logo
1 of 50
Download to read offline
Java SE next 
Otávio Santana 
@otaviojava
OpenJDK 
• Java 7 
• Java 8 
• Java 9
OpenJDK 
hg clone http://hg.openjdk.java.net/jdk9/jdk9 jdk_1_9 
sh ./get_source.sh 
./configure 
make install
OpenJDK 
Java 8 
Java 9 
Compiler 
GC 
Corelibs 
Sumatra 
JavaFX
Companies 
AMD 
Apple 
Azul Systems, Inc. 
Canonical 
Google 
IBM 
Intel 
Oracle 
RedHat 
SAP Software Company 
Stratus 
Twitter
Launched the Java 8 
● Lambda 
● Metaspace 
● Stream
Java 9 
● Build: 31 
● https://jdk9.java.net/download/ 
● Java 8 faster
Java 9 
Reflections wrappers Regex Security Core 
250 
200 
150 
100 
50 
0 
Java 8 - Process 
Java 9 -Process 
Java 8 - Memory 
Java 9 -Memory
Improvements in GC 
● Remove GC combinations deprecated 
● Strings Deduplication 
● Segmented Code Cache 
● Shenandoah
Strings duplication 
75 
25 
Heap 
Another objects String 
● 25% of Heap are Strings 
● 13.5% String duplicates 
String inside Heap 
85 
15 
String Strings duplicates
Segmented 
Code Cache 
● JVM internal (non-method) code 
● Profiled-code 
● Non-profiled code
Sumatra and OpenJFX 
● Use of GPU 
● JavaFX inside OpenJDK
Jigsaw 
● Updated at: 18/08/2014 
● The source, JDK modularized
News to coders 
● Light Write and read to JSON 
● Generics to primitives 
● builders to Collections 
● Literal to Collections 
● Process API Updates 
● Smart Java Compilation 
● http 2.0 client
News 
● List<String> list = List.of(a, b, c); 
● Set<String> set = Set.of(d, e, f, g); 
● Map<String,String> map = 
Map.of(k1, V1);//not collection 
● List<Integer> list = #[ 1, 2, 3 ];
Money Api 
● Take care of money to you :) 
● Formating 
● Rounding 
● Exchange Rate
Money Api 
CurrencyUnit euro = MonetaryCurrencies.getCurrency("EUR"); 
MonetaryAmount money = Money.of(120, euro); 
NumberValue number = money.getNumber(); 
BigDecimal value = number.numberValue(BigDecimal.class);
Money Api 
CurrencyUnit dollar = 
MonetaryCurrencies.getCurrency(Locale.US); 
MonetaryAmount m = Money.of(120, dollar); 
NumberValue number = m.getNumber(); 
BigDecimal value = number.numberValue(BigDecimal.class);
Money Api 
MonetaryAmountFormat format = 
MonetaryFormats.getAmountFormat(Locale.US); 
String text = format.format(m);//12,50 USD 
format = 
MonetaryFormats.getAmountFormat(AmountFormatQueryBuild 
er.create(Locale.US).set(CurrencyStyle.SYMBOL).build()); 
String text = format.format(m);//$123,456.56
Money Api 
MonetaryAmount noMoney = Money.of(0, euro); 
MonetaryAmount m1 = Money.of(10, euro); 
MonetaryAmount m2 = Money.of(30, euro); 
MonetaryAmount m3 = Money.of(40, euro); 
List<MonetaryAmount> moneys = Arrays.asList(m1, m2, m3); 
MonetaryAmount sum = 
moneys.stream().reduce(MonetaryFunctions.sum()).orElse(noM 
oney);
Welcome Lambda 
List<MonetaryAmount> justDollar = moneys.stream() 
.filter((MonetaryFunctions.isCurrency(DOLLAR))) 
.collect(Collectors.toList()); 
List<MonetaryAmount> notEuro = 
moneys.stream().filter((MonetaryFunctions.isNotCurrenc 
y(EURO))).collect(Collectors.toList());
Welcome Lambda 
MonetaryFunctions.isCurrency(DOLLAR).and(Monetary 
Functions.isBetween(min, max))); 
MonetaryFunctions.containsCurrencies(EURO, 
DOLLAR)).or(MonetaryFunctions.isGreaterThan(money 
)));
Welcome Lambda 
List<MonetaryAmount> orderCurrencyValue = 
moneys.stream().sorted(MonetaryFunctions.sortCurrenc 
yUnit().thenComparing(MonetaryFunctions.sortNumber 
())).collect(Collectors.toList()); 
List<MonetaryAmount> orderHighValue = 
moneys.stream().sorted(MonetaryFunctions.sortCurrenc 
yUnit().thenComparing( 
MonetaryFunctions.sortCurrencyUnitDesc())) 
.collect(Collectors.toList());
Welcome Lambda 
Map<CurrencyUnit, List<MonetaryAmount>> groupBy = 
moneys.stream().collect(MonetaryFunctions.groupByCu 
rrencyUnit());
Welcome Lambda 
MonetarySummaryStatistics summary = 
getCurrencies().stream().collect(MonetaryFunctions.sum 
marizingMonetary(DOLLAR)); 
GroupMonetarySummaryStatistics groupSummary = 
getCurrencies().stream().collect(MonetaryFunctions.gro 
upBySummarizingMonetary());
Welcome Lambda 
MonetarySummaryStatistics summary = ... 
MonetaryAmount min = summary.getMin(); 
MonetaryAmount max = summary.getMax(); 
MonetaryAmount sum = summary.getSum(); 
MonetaryAmount avarage = summary.getAverage(); 
Long count = summary.getCount();
Welcome Lambda 
GroupMonetarySummaryStatistics groupSummary =... 
Map<CurrencyUnit, MonetarySummaryStatistics> map = 
groupSummary.get(); 
MonetarySummaryStatistics summaryDollar = 
map.get(DOLLAR);
Exchange Rate 
MonetaryAmount m1 = Money.of(10, euro); 
MonetaryAmount m2 = Money.of(30, dollar); 
m1.add(m2); throw MonetaryException (“Currency mismatch...
Exchange Rate 
ExchangeRateProvider provider = 
MonetaryConversions.getExchangeRateProvider("ECB"); 
MonetaryAmount d2e = 
provider.getCurrencyConversion(euro).apply(mDollar);
Exchange Rate 
ExchangeRateProvider provider = 
MonetaryConversions.getExchangeRateProvider("IMF"); 
MonetaryAmount d2e = 
provider.getCurrencyConversion(euro).apply(mDollar);
Exchange Rate 
List<MonetaryAmount> orderCurrencyValue = 
moneys.stream().sorted(MonetaryFunctions.sortExcha 
nge(provider).collect(Collectors.toList()); 
● 9 BRL 
● 8 USD 
● 7 EUR 
● Because: 
● 1 USD = 2.4203 BRL 
● 1 USD = 2.4203 BRL 
● 1 USD = 0.79 EUR 
● 7 EUR 
● 9 BRL 
● 8 USD
Exchange Rate 
MonetaryAmount sum = 
moneys.stream().reduce(MonetafyFunctions.sum(provider 
, DOLLAR)).orElse(noMoney); 
MonetaryAmount min = 
moneys.stream().reduce(MonetafyFunctions.min(provider 
)).orElse(noMoney); 
MonetaryAmount max = 
moneys.stream().reduce(MonetafyFunctions.max(provide 
r)).orElse(noMoney);
Exchange Rate 
MonetarySummaryStatistics summary = 
getCurrencies().stream().collect(MonetaryFunctions.sum 
marizingMonetary(DOLLAR, provider));
Measurement API 
● Work with Measure 
● Standardize measure unit 
● Format 
● Operations (convert, add, subtract)
Measurement API 
QuantityFactory<Mass> massFactory = 
QuantityFactoryProvider.getQuantityFactory(Mass.class); 
Quantity<Mass> tenKilogram = massFactory.create(10, 
SI.KILOGRAM);
Measurement API 
QuantityFactory<Time> timeFactory = 
QuantityFactory.getInstance(Time.class); 
Quantity<Time> m1 = timeFactory.create(40, MINUTE); 
Quantity<Time> m2 = timeFactory.create(20, MINUTE); 
Quantity<Time> h1 = m1.add(m2).to(HOUR); //1 hour
Measurement API 
QuantityFactory<Time> timeFactory = 
QuantityFactory.getInstance(Time.class); 
Quantity<Time> m1 = timeFactory.create(1, DAY); 
Quantity<Time> m2 = timeFactory.create(12, HOUR); 
Quantity<Time> result = m1.add(m2); //1.5 day
Measurement API 
Quantity<Time> minutes = Quantities.getQuantity(15, 
SI.MINUTE); 
Quantity<Time> hours = Quantities.getQuantity(18, SI.HOUR); 
Quantity<Time> day = Quantities.getQuantity(1, SI.DAY); 
Quantity<Time> seconds = Quantities.getQuantity(100, 
SI.SECOND); 
List<Quantity<Time>> times = new ArrayList<>(); 
times.addAll(Arrays.asList(minutes, hours, day, seconds));
Measurement API 
List<Quantity<Time>> sortNaturalList = times.stream() 
.sorted(QuantityFunctions.sortNatural()) 
.collect(Collectors.toList()); 
● seconds - 100 seconds 
● minutes - 15 minutes 
● hours - 18 hours 
● day - 1 day
Measurement API 
List<Quantity<Time>> sortNaturalList = times.stream() 
.sorted(QuantityFunctions.sortNaturalDesc()) 
.collect(Collectors.toList()); 
● day - 1 day 
● hours - 18 hours 
● minutes - 15 minutes 
● seconds - 100 seconds
Measurement API 
times.add(Quantities.getQuantity(24, SI.HOUR)); 
Comparator<Quantity<Time>> sortNatural = QuantityFunctions.sortNatural(); 
Comparator<Quantity<Time>> sortSymbol = QuantityFunctions.sortSymbol(); 
List<Quantity<Time>> sortNaturaAndSymbolList = times.stream() 
.sorted(sortNatural.thenComparing(sortSymbol)) .collect(Collectors.toList()); 
● seconds - 100 seconds 
● minutes - 15 minutes 
● hours - 18 hours 
● day - 1 day 
● dayInHour – 24 hours
Measurement API 
List<Quantity<Time>> greaterThanOneDay = times 
.stream() 
.filter(QuantityFunctions.isGreaterThan(oneDay)).collect(Collect 
ors.toList()); 
List<Quantity<Time>> greaterThanOneDay = times 
.stream().filter(QuantityFunctions.isBetween(oneHour, 
oneDay)).collect(Collectors.toList());
Measurement API 
Mixing Filters 
QuantityFunctions.isGreaterThan(oneDay).and(QuantityFunctio 
ns.fiterByUnit(SI.HOUR))); 
QuantityFunctions.isGreaterThan(oneDay).or(QuantityFunction 
s.fiterByExcludingUnit(SI.DAY)));
Measurement API 
QuantitySummaryStatistics<Time> summary = 
times.stream().collect(QuantityFunctions.summarizingMeasure( 
SI.HOUR)); //result in hours 
summary.getCount(); 
summary.getAverage(); 
summary.getMax(); 
summary.getMin(); 
summary.getSum();
Measurement API 
QuantitySummaryStatistics<Time> summaryDay = 
summary.to(SI.DAY); 
summary.getMin(SI.MINUTE); 
summary.getMax(SI.MINUTE); 
summary.getSum(SI.MINUTE); 
summary.getAverage(SI.MINUTE);
Measurement API 
Quantity<Time> t1 = timeFactory.create(1, DAY); 
Quantity<Mass> m1 = timeFactory.create(12, KILOGRAM); 
Quantity<Length> l1 = timeFactory.create(12, KILOGRAM); 
t1.add(m1); //error 
Quantity<Speed> s1 = l1.divide(t1).asType(Speed.class);
Measurement API 
● Acceleration 
● Length 
● Angle 
● Area 
● Mass 
● Power 
● Energy 
● Speed 
● Force 
● Temperature 
● Time 
● Information 
● Volume 
And more! 52 quantities
It isn't a Spoiler 
Sunday, September 28 
12:30 p.m.–3:00 p.m. 
Moscone North, Hall D 
Thursday, October 2 
9:00 a.m.–10:45 a.m. 
Marriott Marquis, Salon 7/8/9
Thank you 
Otávio Santana 
@otaviojava

More Related Content

What's hot

Baksik3 enug baksik_xmlinvoice
Baksik3 enug baksik_xmlinvoiceBaksik3 enug baksik_xmlinvoice
Baksik3 enug baksik_xmlinvoice
ENUG
 
Working With JQuery Part1
Working With JQuery Part1Working With JQuery Part1
Working With JQuery Part1
saydin_soft
 

What's hot (19)

The Ring programming language version 1.6 book - Part 9 of 189
The Ring programming language version 1.6 book - Part 9 of 189The Ring programming language version 1.6 book - Part 9 of 189
The Ring programming language version 1.6 book - Part 9 of 189
 
project
projectproject
project
 
Developer Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duoDeveloper Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duo
 
“SOLID principles in PHP – how to apply them in PHP and why should we care“ b...
“SOLID principles in PHP – how to apply them in PHP and why should we care“ b...“SOLID principles in PHP – how to apply them in PHP and why should we care“ b...
“SOLID principles in PHP – how to apply them in PHP and why should we care“ b...
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
Baksik3 enug baksik_xmlinvoice
Baksik3 enug baksik_xmlinvoiceBaksik3 enug baksik_xmlinvoice
Baksik3 enug baksik_xmlinvoice
 
Apache spark: in and out
Apache spark: in and outApache spark: in and out
Apache spark: in and out
 
Working With JQuery Part1
Working With JQuery Part1Working With JQuery Part1
Working With JQuery Part1
 
Практическое применения Akka Streams
Практическое применения Akka StreamsПрактическое применения Akka Streams
Практическое применения Akka Streams
 
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
 
TDC2018SP | Trilha Go - Processando analise genetica em background com Go
TDC2018SP | Trilha Go - Processando analise genetica em background com GoTDC2018SP | Trilha Go - Processando analise genetica em background com Go
TDC2018SP | Trilha Go - Processando analise genetica em background com Go
 
RxSwift 활용하기 - Let'Swift 2017
RxSwift 활용하기 - Let'Swift 2017RxSwift 활용하기 - Let'Swift 2017
RxSwift 활용하기 - Let'Swift 2017
 
Finch + Finagle OAuth2
Finch + Finagle OAuth2Finch + Finagle OAuth2
Finch + Finagle OAuth2
 
Import data from csv excel file and export to xml excel file in c programming
Import data from csv excel file and export to xml excel file in c programmingImport data from csv excel file and export to xml excel file in c programming
Import data from csv excel file and export to xml excel file in c programming
 
V8
V8V8
V8
 
2013 - Benjamin Eberlei - Doctrine 2
2013 - Benjamin Eberlei - Doctrine 22013 - Benjamin Eberlei - Doctrine 2
2013 - Benjamin Eberlei - Doctrine 2
 
Async Microservices with Twitter's Finagle
Async Microservices with Twitter's FinagleAsync Microservices with Twitter's Finagle
Async Microservices with Twitter's Finagle
 
Building fast interpreters in Rust
Building fast interpreters in RustBuilding fast interpreters in Rust
Building fast interpreters in Rust
 
Scala on Your Phone
Scala on Your PhoneScala on Your Phone
Scala on Your Phone
 

Viewers also liked

Viewers also liked (16)

Projeto OpenJDK [Java8]
Projeto OpenJDK [Java8]Projeto OpenJDK [Java8]
Projeto OpenJDK [Java8]
 
Javase next
Javase nextJavase next
Javase next
 
Dinheiro em Java: Joda-Money, Money API e além
Dinheiro em Java: Joda-Money, Money API e alémDinheiro em Java: Joda-Money, Money API e além
Dinheiro em Java: Joda-Money, Money API e além
 
JSR 375 Segurança em Java EE 8
JSR 375 Segurança em Java EE 8JSR 375 Segurança em Java EE 8
JSR 375 Segurança em Java EE 8
 
Java ME API Next
 Java ME API Next Java ME API Next
Java ME API Next
 
Open Source e Humanidade: mas o que minha carreira tem com isso?
Open Source e Humanidade: mas o que minha carreira tem com isso? Open Source e Humanidade: mas o que minha carreira tem com isso?
Open Source e Humanidade: mas o que minha carreira tem com isso?
 
Javamagazine20141112 dl
Javamagazine20141112 dlJavamagazine20141112 dl
Javamagazine20141112 dl
 
Jsummit 2014
Jsummit 2014Jsummit 2014
Jsummit 2014
 
Java magazine november/december 2014
Java magazine november/december 2014Java magazine november/december 2014
Java magazine november/december 2014
 
Nosql4java
Nosql4javaNosql4java
Nosql4java
 
Visão geral da segurança em Java EE
Visão geral da segurança em Java EEVisão geral da segurança em Java EE
Visão geral da segurança em Java EE
 
Lab
LabLab
Lab
 
Gráficos Vetoriais na Web com SVG
Gráficos Vetoriais na Web com SVGGráficos Vetoriais na Web com SVG
Gráficos Vetoriais na Web com SVG
 
Introdução Ao Spring Com Spring Boot
Introdução Ao Spring Com Spring BootIntrodução Ao Spring Com Spring Boot
Introdução Ao Spring Com Spring Boot
 
Padrões de Integração de Sistemas com Spring Integration
Padrões de Integração de Sistemas com Spring IntegrationPadrões de Integração de Sistemas com Spring Integration
Padrões de Integração de Sistemas com Spring Integration
 
Let's talk about NoSQL Standard
Let's talk about NoSQL StandardLet's talk about NoSQL Standard
Let's talk about NoSQL Standard
 

Similar to Java Se next Generetion

Performance measurement and tuning
Performance measurement and tuningPerformance measurement and tuning
Performance measurement and tuning
AOE
 
Hybrid rule engines (rulesfest 2010)
Hybrid rule engines (rulesfest 2010)Hybrid rule engines (rulesfest 2010)
Hybrid rule engines (rulesfest 2010)
Geoffrey De Smet
 
Writing MySQL User-defined Functions in JavaScript
Writing MySQL User-defined Functions in JavaScriptWriting MySQL User-defined Functions in JavaScript
Writing MySQL User-defined Functions in JavaScript
Roland Bouman
 
Session 6 sv_randomization
Session 6 sv_randomizationSession 6 sv_randomization
Session 6 sv_randomization
Nirav Desai
 

Similar to Java Se next Generetion (20)

MySQL Stored Procedures: Building High Performance Web Applications
MySQL Stored Procedures: Building High Performance Web ApplicationsMySQL Stored Procedures: Building High Performance Web Applications
MySQL Stored Procedures: Building High Performance Web Applications
 
Compose Async with RxJS
Compose Async with RxJSCompose Async with RxJS
Compose Async with RxJS
 
JSR 354 Hackday - What you can do...
JSR 354 Hackday - What you can do...JSR 354 Hackday - What you can do...
JSR 354 Hackday - What you can do...
 
Performance measurement and tuning
Performance measurement and tuningPerformance measurement and tuning
Performance measurement and tuning
 
R Language
R LanguageR Language
R Language
 
Testing in the World of Functional Programming
Testing in the World of Functional ProgrammingTesting in the World of Functional Programming
Testing in the World of Functional Programming
 
Hybrid rule engines (rulesfest 2010)
Hybrid rule engines (rulesfest 2010)Hybrid rule engines (rulesfest 2010)
Hybrid rule engines (rulesfest 2010)
 
JSR 354 LJC-Hackday
JSR 354 LJC-HackdayJSR 354 LJC-Hackday
JSR 354 LJC-Hackday
 
Monitoring und Metriken im Wunderland
Monitoring und Metriken im WunderlandMonitoring und Metriken im Wunderland
Monitoring und Metriken im Wunderland
 
Distributed Real-Time Stream Processing: Why and How 2.0
Distributed Real-Time Stream Processing:  Why and How 2.0Distributed Real-Time Stream Processing:  Why and How 2.0
Distributed Real-Time Stream Processing: Why and How 2.0
 
Serverless stateful
Serverless statefulServerless stateful
Serverless stateful
 
Test s velocity_15_5_4
Test s velocity_15_5_4Test s velocity_15_5_4
Test s velocity_15_5_4
 
Writing MySQL User-defined Functions in JavaScript
Writing MySQL User-defined Functions in JavaScriptWriting MySQL User-defined Functions in JavaScript
Writing MySQL User-defined Functions in JavaScript
 
Distributed Real-Time Stream Processing: Why and How: Spark Summit East talk ...
Distributed Real-Time Stream Processing: Why and How: Spark Summit East talk ...Distributed Real-Time Stream Processing: Why and How: Spark Summit East talk ...
Distributed Real-Time Stream Processing: Why and How: Spark Summit East talk ...
 
Distributed Stream Processing - Spark Summit East 2017
Distributed Stream Processing - Spark Summit East 2017Distributed Stream Processing - Spark Summit East 2017
Distributed Stream Processing - Spark Summit East 2017
 
RxJava applied [JavaDay Kyiv 2016]
RxJava applied [JavaDay Kyiv 2016]RxJava applied [JavaDay Kyiv 2016]
RxJava applied [JavaDay Kyiv 2016]
 
My Top 5 APEX JavaScript API's
My Top 5 APEX JavaScript API'sMy Top 5 APEX JavaScript API's
My Top 5 APEX JavaScript API's
 
Javascript Memory leaks and Performance & Angular
Javascript Memory leaks and Performance & AngularJavascript Memory leaks and Performance & Angular
Javascript Memory leaks and Performance & Angular
 
R console
R consoleR console
R console
 
Session 6 sv_randomization
Session 6 sv_randomizationSession 6 sv_randomization
Session 6 sv_randomization
 

More from Otávio Santana

More from Otávio Santana (20)

NoSQL design pitfalls with Java
NoSQL design pitfalls with JavaNoSQL design pitfalls with Java
NoSQL design pitfalls with Java
 
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
 
Architecting Cloud Computing Solutions with Java [1.1]
Architecting Cloud Computing Solutions with Java [1.1]Architecting Cloud Computing Solutions with Java [1.1]
Architecting Cloud Computing Solutions with Java [1.1]
 
Arquitetando soluções de computação em nuvem com Java
Arquitetando soluções de computação em nuvem com JavaArquitetando soluções de computação em nuvem com Java
Arquitetando soluções de computação em nuvem com Java
 
Build, run, and scale your Java applications end to end
Build, run, and scale your Java applications end to endBuild, run, and scale your Java applications end to end
Build, run, and scale your Java applications end to end
 
Jakarta NoSQL: Meet the first Jakarta EE specification in the Cloud
Jakarta NoSQL: Meet the first Jakarta EE specification in the CloudJakarta NoSQL: Meet the first Jakarta EE specification in the Cloud
Jakarta NoSQL: Meet the first Jakarta EE specification in the Cloud
 
ORMs: Heroes or Villains Inside the Architecture?
ORMs: Heroes or Villains Inside the Architecture?ORMs: Heroes or Villains Inside the Architecture?
ORMs: Heroes or Villains Inside the Architecture?
 
Jakarta EE Meets NoSQL at the Cloud Age
Jakarta EE Meets NoSQL at the Cloud AgeJakarta EE Meets NoSQL at the Cloud Age
Jakarta EE Meets NoSQL at the Cloud Age
 
Boost your APIs with GraphQL 1.0
Boost your APIs with GraphQL 1.0Boost your APIs with GraphQL 1.0
Boost your APIs with GraphQL 1.0
 
Jakarta EE Meets NoSQL in the Cloud Age [DEV6109]
Jakarta EE Meets NoSQL in the Cloud Age [DEV6109]Jakarta EE Meets NoSQL in the Cloud Age [DEV6109]
Jakarta EE Meets NoSQL in the Cloud Age [DEV6109]
 
Let’s Make Graph Databases Fun Again with Java [DEV6043]
Let’s Make Graph Databases Fun Again with Java [DEV6043]Let’s Make Graph Databases Fun Again with Java [DEV6043]
Let’s Make Graph Databases Fun Again with Java [DEV6043]
 
Eclipse JNoSQL: One API to Many NoSQL Databases - BYOL [HOL5998]
Eclipse JNoSQL: One API to Many NoSQL Databases - BYOL [HOL5998]Eclipse JNoSQL: One API to Many NoSQL Databases - BYOL [HOL5998]
Eclipse JNoSQL: One API to Many NoSQL Databases - BYOL [HOL5998]
 
The new generation of data persistence with graph
The new generation of data persistence with graphThe new generation of data persistence with graph
The new generation of data persistence with graph
 
Eclipse JNoSQL updates from JCP September 11
Eclipse JNoSQL updates from JCP September 11Eclipse JNoSQL updates from JCP September 11
Eclipse JNoSQL updates from JCP September 11
 
Stateless Microservice Security via JWT and MicroProfile - Guatemala
Stateless Microservice Security via JWT and MicroProfile - GuatemalaStateless Microservice Security via JWT and MicroProfile - Guatemala
Stateless Microservice Security via JWT and MicroProfile - Guatemala
 
Stateless Microservice Security via JWT and MicroProfile - Mexico
Stateless Microservice Security via JWT and MicroProfile - MexicoStateless Microservice Security via JWT and MicroProfile - Mexico
Stateless Microservice Security via JWT and MicroProfile - Mexico
 
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL Database
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL DatabaseEclipse JNoSQL: The Definitive Solution for Java and NoSQL Database
Eclipse JNoSQL: The Definitive Solution for Java and NoSQL Database
 
Polyglot persistence
Polyglot persistencePolyglot persistence
Polyglot persistence
 
Management 3.0 and open source
Management 3.0 and open sourceManagement 3.0 and open source
Management 3.0 and open source
 
Building a Recommendation Engine with Java EE
Building a Recommendation Engine with Java EEBuilding a Recommendation Engine with Java EE
Building a Recommendation Engine with Java EE
 

Recently uploaded

Recently uploaded (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Java Se next Generetion

  • 1. Java SE next Otávio Santana @otaviojava
  • 2. OpenJDK • Java 7 • Java 8 • Java 9
  • 3. OpenJDK hg clone http://hg.openjdk.java.net/jdk9/jdk9 jdk_1_9 sh ./get_source.sh ./configure make install
  • 4. OpenJDK Java 8 Java 9 Compiler GC Corelibs Sumatra JavaFX
  • 5.
  • 6. Companies AMD Apple Azul Systems, Inc. Canonical Google IBM Intel Oracle RedHat SAP Software Company Stratus Twitter
  • 7. Launched the Java 8 ● Lambda ● Metaspace ● Stream
  • 8. Java 9 ● Build: 31 ● https://jdk9.java.net/download/ ● Java 8 faster
  • 9. Java 9 Reflections wrappers Regex Security Core 250 200 150 100 50 0 Java 8 - Process Java 9 -Process Java 8 - Memory Java 9 -Memory
  • 10. Improvements in GC ● Remove GC combinations deprecated ● Strings Deduplication ● Segmented Code Cache ● Shenandoah
  • 11. Strings duplication 75 25 Heap Another objects String ● 25% of Heap are Strings ● 13.5% String duplicates String inside Heap 85 15 String Strings duplicates
  • 12. Segmented Code Cache ● JVM internal (non-method) code ● Profiled-code ● Non-profiled code
  • 13. Sumatra and OpenJFX ● Use of GPU ● JavaFX inside OpenJDK
  • 14. Jigsaw ● Updated at: 18/08/2014 ● The source, JDK modularized
  • 15. News to coders ● Light Write and read to JSON ● Generics to primitives ● builders to Collections ● Literal to Collections ● Process API Updates ● Smart Java Compilation ● http 2.0 client
  • 16. News ● List<String> list = List.of(a, b, c); ● Set<String> set = Set.of(d, e, f, g); ● Map<String,String> map = Map.of(k1, V1);//not collection ● List<Integer> list = #[ 1, 2, 3 ];
  • 17. Money Api ● Take care of money to you :) ● Formating ● Rounding ● Exchange Rate
  • 18. Money Api CurrencyUnit euro = MonetaryCurrencies.getCurrency("EUR"); MonetaryAmount money = Money.of(120, euro); NumberValue number = money.getNumber(); BigDecimal value = number.numberValue(BigDecimal.class);
  • 19. Money Api CurrencyUnit dollar = MonetaryCurrencies.getCurrency(Locale.US); MonetaryAmount m = Money.of(120, dollar); NumberValue number = m.getNumber(); BigDecimal value = number.numberValue(BigDecimal.class);
  • 20. Money Api MonetaryAmountFormat format = MonetaryFormats.getAmountFormat(Locale.US); String text = format.format(m);//12,50 USD format = MonetaryFormats.getAmountFormat(AmountFormatQueryBuild er.create(Locale.US).set(CurrencyStyle.SYMBOL).build()); String text = format.format(m);//$123,456.56
  • 21. Money Api MonetaryAmount noMoney = Money.of(0, euro); MonetaryAmount m1 = Money.of(10, euro); MonetaryAmount m2 = Money.of(30, euro); MonetaryAmount m3 = Money.of(40, euro); List<MonetaryAmount> moneys = Arrays.asList(m1, m2, m3); MonetaryAmount sum = moneys.stream().reduce(MonetaryFunctions.sum()).orElse(noM oney);
  • 22. Welcome Lambda List<MonetaryAmount> justDollar = moneys.stream() .filter((MonetaryFunctions.isCurrency(DOLLAR))) .collect(Collectors.toList()); List<MonetaryAmount> notEuro = moneys.stream().filter((MonetaryFunctions.isNotCurrenc y(EURO))).collect(Collectors.toList());
  • 23. Welcome Lambda MonetaryFunctions.isCurrency(DOLLAR).and(Monetary Functions.isBetween(min, max))); MonetaryFunctions.containsCurrencies(EURO, DOLLAR)).or(MonetaryFunctions.isGreaterThan(money )));
  • 24. Welcome Lambda List<MonetaryAmount> orderCurrencyValue = moneys.stream().sorted(MonetaryFunctions.sortCurrenc yUnit().thenComparing(MonetaryFunctions.sortNumber ())).collect(Collectors.toList()); List<MonetaryAmount> orderHighValue = moneys.stream().sorted(MonetaryFunctions.sortCurrenc yUnit().thenComparing( MonetaryFunctions.sortCurrencyUnitDesc())) .collect(Collectors.toList());
  • 25. Welcome Lambda Map<CurrencyUnit, List<MonetaryAmount>> groupBy = moneys.stream().collect(MonetaryFunctions.groupByCu rrencyUnit());
  • 26. Welcome Lambda MonetarySummaryStatistics summary = getCurrencies().stream().collect(MonetaryFunctions.sum marizingMonetary(DOLLAR)); GroupMonetarySummaryStatistics groupSummary = getCurrencies().stream().collect(MonetaryFunctions.gro upBySummarizingMonetary());
  • 27. Welcome Lambda MonetarySummaryStatistics summary = ... MonetaryAmount min = summary.getMin(); MonetaryAmount max = summary.getMax(); MonetaryAmount sum = summary.getSum(); MonetaryAmount avarage = summary.getAverage(); Long count = summary.getCount();
  • 28. Welcome Lambda GroupMonetarySummaryStatistics groupSummary =... Map<CurrencyUnit, MonetarySummaryStatistics> map = groupSummary.get(); MonetarySummaryStatistics summaryDollar = map.get(DOLLAR);
  • 29. Exchange Rate MonetaryAmount m1 = Money.of(10, euro); MonetaryAmount m2 = Money.of(30, dollar); m1.add(m2); throw MonetaryException (“Currency mismatch...
  • 30. Exchange Rate ExchangeRateProvider provider = MonetaryConversions.getExchangeRateProvider("ECB"); MonetaryAmount d2e = provider.getCurrencyConversion(euro).apply(mDollar);
  • 31. Exchange Rate ExchangeRateProvider provider = MonetaryConversions.getExchangeRateProvider("IMF"); MonetaryAmount d2e = provider.getCurrencyConversion(euro).apply(mDollar);
  • 32. Exchange Rate List<MonetaryAmount> orderCurrencyValue = moneys.stream().sorted(MonetaryFunctions.sortExcha nge(provider).collect(Collectors.toList()); ● 9 BRL ● 8 USD ● 7 EUR ● Because: ● 1 USD = 2.4203 BRL ● 1 USD = 2.4203 BRL ● 1 USD = 0.79 EUR ● 7 EUR ● 9 BRL ● 8 USD
  • 33. Exchange Rate MonetaryAmount sum = moneys.stream().reduce(MonetafyFunctions.sum(provider , DOLLAR)).orElse(noMoney); MonetaryAmount min = moneys.stream().reduce(MonetafyFunctions.min(provider )).orElse(noMoney); MonetaryAmount max = moneys.stream().reduce(MonetafyFunctions.max(provide r)).orElse(noMoney);
  • 34. Exchange Rate MonetarySummaryStatistics summary = getCurrencies().stream().collect(MonetaryFunctions.sum marizingMonetary(DOLLAR, provider));
  • 35. Measurement API ● Work with Measure ● Standardize measure unit ● Format ● Operations (convert, add, subtract)
  • 36. Measurement API QuantityFactory<Mass> massFactory = QuantityFactoryProvider.getQuantityFactory(Mass.class); Quantity<Mass> tenKilogram = massFactory.create(10, SI.KILOGRAM);
  • 37. Measurement API QuantityFactory<Time> timeFactory = QuantityFactory.getInstance(Time.class); Quantity<Time> m1 = timeFactory.create(40, MINUTE); Quantity<Time> m2 = timeFactory.create(20, MINUTE); Quantity<Time> h1 = m1.add(m2).to(HOUR); //1 hour
  • 38. Measurement API QuantityFactory<Time> timeFactory = QuantityFactory.getInstance(Time.class); Quantity<Time> m1 = timeFactory.create(1, DAY); Quantity<Time> m2 = timeFactory.create(12, HOUR); Quantity<Time> result = m1.add(m2); //1.5 day
  • 39. Measurement API Quantity<Time> minutes = Quantities.getQuantity(15, SI.MINUTE); Quantity<Time> hours = Quantities.getQuantity(18, SI.HOUR); Quantity<Time> day = Quantities.getQuantity(1, SI.DAY); Quantity<Time> seconds = Quantities.getQuantity(100, SI.SECOND); List<Quantity<Time>> times = new ArrayList<>(); times.addAll(Arrays.asList(minutes, hours, day, seconds));
  • 40. Measurement API List<Quantity<Time>> sortNaturalList = times.stream() .sorted(QuantityFunctions.sortNatural()) .collect(Collectors.toList()); ● seconds - 100 seconds ● minutes - 15 minutes ● hours - 18 hours ● day - 1 day
  • 41. Measurement API List<Quantity<Time>> sortNaturalList = times.stream() .sorted(QuantityFunctions.sortNaturalDesc()) .collect(Collectors.toList()); ● day - 1 day ● hours - 18 hours ● minutes - 15 minutes ● seconds - 100 seconds
  • 42. Measurement API times.add(Quantities.getQuantity(24, SI.HOUR)); Comparator<Quantity<Time>> sortNatural = QuantityFunctions.sortNatural(); Comparator<Quantity<Time>> sortSymbol = QuantityFunctions.sortSymbol(); List<Quantity<Time>> sortNaturaAndSymbolList = times.stream() .sorted(sortNatural.thenComparing(sortSymbol)) .collect(Collectors.toList()); ● seconds - 100 seconds ● minutes - 15 minutes ● hours - 18 hours ● day - 1 day ● dayInHour – 24 hours
  • 43. Measurement API List<Quantity<Time>> greaterThanOneDay = times .stream() .filter(QuantityFunctions.isGreaterThan(oneDay)).collect(Collect ors.toList()); List<Quantity<Time>> greaterThanOneDay = times .stream().filter(QuantityFunctions.isBetween(oneHour, oneDay)).collect(Collectors.toList());
  • 44. Measurement API Mixing Filters QuantityFunctions.isGreaterThan(oneDay).and(QuantityFunctio ns.fiterByUnit(SI.HOUR))); QuantityFunctions.isGreaterThan(oneDay).or(QuantityFunction s.fiterByExcludingUnit(SI.DAY)));
  • 45. Measurement API QuantitySummaryStatistics<Time> summary = times.stream().collect(QuantityFunctions.summarizingMeasure( SI.HOUR)); //result in hours summary.getCount(); summary.getAverage(); summary.getMax(); summary.getMin(); summary.getSum();
  • 46. Measurement API QuantitySummaryStatistics<Time> summaryDay = summary.to(SI.DAY); summary.getMin(SI.MINUTE); summary.getMax(SI.MINUTE); summary.getSum(SI.MINUTE); summary.getAverage(SI.MINUTE);
  • 47. Measurement API Quantity<Time> t1 = timeFactory.create(1, DAY); Quantity<Mass> m1 = timeFactory.create(12, KILOGRAM); Quantity<Length> l1 = timeFactory.create(12, KILOGRAM); t1.add(m1); //error Quantity<Speed> s1 = l1.divide(t1).asType(Speed.class);
  • 48. Measurement API ● Acceleration ● Length ● Angle ● Area ● Mass ● Power ● Energy ● Speed ● Force ● Temperature ● Time ● Information ● Volume And more! 52 quantities
  • 49. It isn't a Spoiler Sunday, September 28 12:30 p.m.–3:00 p.m. Moscone North, Hall D Thursday, October 2 9:00 a.m.–10:45 a.m. Marriott Marquis, Salon 7/8/9
  • 50. Thank you Otávio Santana @otaviojava