SlideShare a Scribd company logo
1 of 78
Download to read offline
Java 21 and Beyond
A Roadmap of Innovations
Java Champion Alumni, Certified Architect
Senior Developer Advocate at Oracle
Passionate about solving complex scenarios
involving Java and Kubernetes.
ammbra1508 ammbra1508.mastodon.social
“The only way you can predict the
future is to build it”
Alan Kay
Download and give it try: https://jdk.java.net/21/
6-Month Release Cadence
Sept
2017
Mar
2018
Sept
2018
Mar
2019
Sept
2019
Mar
2020
Sept
2020
Mar
2021
Sept
2021
Mar
2014
3 +
Years
6
Months
6
Months
6
Months
6
Months
6
Months
6
Months
6
Months
6
Months
JDK 8 JDK 9 JDK 10 JDK 11 JDK 12 JDK 13 JDK 14 JDK 15 JDK 16 JDK 17 JDK 18
Mar
2022
6
Months
JDK 19
Sept
2022
6
Months
JDK 20 JDK 21
Mar
2023
Sept
2023
Commercial
Support
Commercial
Support
Commercial
Support
Commercial
Support
6
Months
6
Months
Innovating for the Future
Panama
Improving and
enriching the
connections
between the Java
virtual machine
and well-defined
but “foreign”
(non-Java) APIs
Valhalla
Higher density and
performance of
machine learning
and big data
applications
through the
introduction of
inline classes.
Loom
Massively scale
lightweight
threads, making
concurrency
simple again.
Amber
Continuously
improve developer
productivity
through evolutions
of the Java
language.
Leyden
Address long-term
pain points of
Java’s start-up
time, time to peak
performance and
large footprint.
ZGC
Create a scalable
low latency
garbage collector
capable of
handling large
heaps.
openjdk.org
A Minimal Java Setup
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
☕ A JDK (includes JDK tools like javac and java)
☕ An Integrated Development Environment (IDE)
☕ A build tool (maven, gradle, basel etc)
☕ (Boilerplate) Java code
Towards a Simplified Beginning
☕ Use jshell for fast prototyping Java code
☕ Since JDK 11 you have single-file execution
java HelloWorld.java
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
Towards a Simplified Beginning
☕ Use jshell for fast prototyping Java code
☕ Since JDK 11 you have single-file execution
java HelloWorld.java
☕ JEP 458 proposes the ability to run a program supplied as
multiple files of Java code
java --class-path ‘*’ HelloWorld.java
// HelloWorld.java
class HelloWorld {
public static void main(String[] args) {
Helper.run();
}
}
// Helper.java
class Helper {
static void run() { System.out.println("Hello
World!");
}
}
A Simplified Begining
Project Amber
Effective Scripting with Java
// HelloWorld.java
void main() {
Helper.run();
}
// Helper.java
class Helper {
static void run() { System.out.println("Hello
World!");
}
}
JEP 445 proposes to reduce mandatory Java concepts
☕ Class declaration no longer required
☕ main is not necessarily public static
☕ String[] args not declared if not used further
Invocation Order When Selecting Main
☕ A static void main(String[] args) method of non-private access in the launched class.
☕ A static void main() method with non-private access in the launched class.
☕ A non-private void main(String[] args) instance method in the launched class/inherited from a
superclass.
☕ A non-private void main() instance method in the launched class or inherited from a superclass.
So You Want to Know More…
☕ JEP 445:Unnamed Classes and Instance Main Methods(Preview)
☕ JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview)
☕ Script Java Easily in 21 and Beyond - Inside Java Newscast #49
☕ JEP 458: Launch Multi-File Source-Code Programs
Record Patterns
Less Boilerplate, More Fun
Project Amber
Express Semantic Intent of Your Models
// Prior to Java 16
if (obj instanceof Postcard) {
Postcard p = (Postcard)obj;
... use p ...
}
// As of Java 16
if (obj instanceof Postcard p) {
... use p ...
}
Pattern Matching and Records
Intention intention = new Present(24.2, 1.5, “RON”);
// As of Java 16
if (intention instanceof Present p) {
double itemPrice = p.itemPrice();
double boxPrice = p.boxPrice();
System.out.println(itemPrice + boxPrice);
}
// As of Java 21
if (intention instanceof Present(double itemPrice, double boxPrice, Currency c)) {
System.out.println(itemPrice + boxPrice);
}
Wrapup Expressive Data Modeling
☕ A sender can do a nice gesture and offer a gift.
☕ A gift can be either a postcard or add to it one of
the following: an online coupon, buy an experience
or a material present.
☕ A postcard does not have an associated cost, all the
other 3 types of gifts have a price.
☕ An online coupon has an expiry date.
☕ A present can be placed inside a box.
☕ A sender can give a different postcard or surprise
depending on celebration, but never send 2
postcards as a gift.
Wrapup Expressive Data Modeling
☕ A common formatting process to JSON through
public sealed interface Intention
permits Coupon, Experience,
Present, Postcard {
//…
}
Wrapup Expressive Data Modeling
☕ A common formatting process to JSON through
public sealed interface Intention
permits Coupon, Experience,
Present, Postcard {
//…
}
☕ Coupon, Experience, Present, Postcard
are records
☕ Represent Gift using nested record patterns
Working With Nested Record Patterns
public record Postcard(String sender, String receiver, Celebration celebration)
implements Intention{}
public record Experience(double price, Currency currency)implements Intention{}
record Gift(Postcard postcard, Intention intention) {}
// As of Java 21
if (gift instanceof Gift(Postcard p, Experience e)) {
System.out.println("Price of experience is expressed in" + e.currency())
}
Working With Nested Record Patterns
public record Postcard(String sender, String receiver, Celebration celebration)
implements Intention{}
public record Experience(double price, Currency currency)implements Intention{}
record Gift(Postcard postcard, Intention intention) {}
// As of Java 21
if (gift instanceof Gift(Postcard p, Experience (double price, Currency c ))) {
System.out.println("Price of experience is expressed in" + c);
}
Working With Nested Record Patterns
public record Postcard(String sender, String receiver, Celebration celebration)
implements Intention{}
public record Experience(double price, Currency currency)implements Intention{}
record Gift(Postcard postcard, Intention intention) {}
// As of Java 21
if (gift instanceof Gift(var p, Experience (var price, Currency c ))) {
System.out.println("Price of experience is expressed in" + c);
}
So You Want To Know More…
☕ Clean Application Development with Records, Sealed Classes and Pattern Matching (2022)
☕ Java Records are "Trusted" and Consequently Faster
☕ Java 21 New Feature: Sequenced Collections - JEP Cafe #19
☕ JEP 440:Record Patterns
String Templates
A Match Made in Java Heaven
Project Amber
String Templates Components
String data = STR. """
{
"sender": "Ana",
"receiver": "Duke",
"celebration": "{ celebration}",
"option" : "{ Choice.NONE }"
}
""" ;
☕ A template processor (STR),
☕ A dot character (U+002E),
☕ A template which can contain an embedded
expression ({celebration}).
Use the Template Processor API
package java.lang;
public interface StringTemplate {
...
@FunctionalInterface
public interface Processor<R, E extends Throwable> {
R process(StringTemplate st) throws E;
}
...
}
Use the Template Processor API
public interface StringTemplate {
...
@FunctionalInterface
public interface Processor<R, E extends Throwable> {
R process(StringTemplate st) throws E;
}
...
} public sealed interface Intention
permits Coupon, Experience, Present, Postcard {
StringTemplate.Processor<JSONObject, RuntimeException> JSON = StringTemplate.Processor.of(
(StringTemplate st) -> new JSONObject(st.interpolate())
);
JSONObject asJSON();
}
Use the Template Processor API
public record Present(double itemPrice, double boxPrice, Currency currency)
implements Intention {
@Override
public JSONObject asJSON() {
return JSON. """
{
"currency": "{currency}",
"boxPrice": "{boxPrice}",
"packaged" : "{ boxPrice > 0.0}",
"cost": "{(boxPrice > 0.0) ? itemPrice + boxPrice : itemPrice}"
};
""" ;
}
}
Use the Template Processor API
public record Present(double itemPrice, double boxPrice, Currency currency)
implements Intention {
@Override
public JSONObject asJSON() {
return JSON. """
{
"currency": "{currency}",
"boxPrice": "{boxPrice}",
"packaged" : "{ boxPrice > 0.0}",
"cost": "{(boxPrice > 0.0) ? itemPrice + boxPrice : itemPrice}"
};
""" ;
}
}
Use the Template Processor API
public record Present(double itemPrice, double boxPrice, Currency currency)
implements Intention {
@Override
public JSONObject asJSON() {
return JSON. """
{
"currency": "{currency}",
"boxPrice": "{boxPrice}",
"packaged" : "{ boxPrice > 0.0}",
"cost": "{(boxPrice > 0.0) ? itemPrice + boxPrice : itemPrice}"
};
""" ;
}
}
So You Want to Know More…
☕ Interpolate Strings Like a King in Java 21 - Inside Java Newscast #47
☕ String Tapas Redux by Jim Laskey and Brian Goetz
☕ JEP 430: String Templates (Preview)
☕ JEP 459: String Templates (Second Preview)
☕ Stepping in 2024 with Powerful Java Language Features
Attain Code Clarity with
Pattern Matching for Switch
Project Amber
Many Flavors Of Pattern Matching & Switch
☕ Test the equality of a variable against several values specified in the cases
☕ More expressiveness and utility of switch expressions
☕ Mitigate the strict null-handling behavior of switch
☕ Augment security of switch statements
☕ Guarantee backward compatibility for all existing switch expressions and statements
Let’s Add Some Style to Postcard
Font font = postcard.celebration().getStyle();
switch(font) {
case Style s when s == Style.BOLD -> {
System.out.println("It's bold");
}
case Style s when s == Style.REGULAR -> {
System.out.println("It's regular");
}
case Style s -> System.out.println("Other styles");
case Color c -> System.out.println("It's colored");
}
Since JDK 21
☕ No more parenthesized patterns
☕ Qualified enum constants can
be case constants in switch expressions
and statements.
Record Patterns and Exhaustive Switch
JSONObject process(Gift gift, Choice choice) {
return switch (gift) {
case Gift(Postcard p, Postcard p2) -> p.asJSON();
case Gift(Postcard p, Coupon c) when (c.price() == 0.0) -> p.asJSON();
case Gift(Postcard p, Experience e) when (e.price() == 0.0) -> p.asJSON();
case Gift(Postcard p, Present pr) when (pr.itemPrice() == 0.0) -> p.asJSON();
case Gift(Postcard p, Experience e) -> gift.merge(choice.name().toLowerCase());
case Gift(Postcard p, Present pr) -> gift.merge(choice.name().toLowerCase());
case Gift(Postcard p, Coupon c) -> gift.merge(choice.name().toLowerCase());
};
}
So You Want To Know More…
☕ State of Pattern Matching with Brian Goetz (2022)
☕ Pattern Matching in the Java Object Model
☕ Patterns: Exhaustiveness, Unconditionality, and Remainder
☕ JEP 441: Pattern Matching for switch
☕ Uniform handling of failure in switch
Unnamed Patterns and
Variables to Improve Code
Maintainability
Project Amber
Code Readability and Lower Error Chances
JSONObject process(Gift gift, Choice choice) {
return switch (gift) {
case Gift(Postcard p, Postcard _) -> p.asJSON();
case Gift(Postcard p, Coupon c) when (c.price() == 0.0) -> p.asJSON();
case Gift(Postcard p, Experience e) when (e.price() == 0.0) -> p.asJSON();
case Gift(Postcard p, Present pr) when (pr.itemPrice() == 0.0) -> p.asJSON();
case Gift(_, Coupon _), Gift(_, Experience _), Gift(_, Present _) -> {
String option = choice.name().toLowerCase();
yield gift.merge(option);
}
};
}
Image by geralt from Pixabay
SequencedCollections
From First to Last and
Everything Reversed
JEP 431: Sequenced Collections: https://openjdk.org/jeps/431
Core Library
A World Without SequencedCollections
☕ Each collection gets first and last element in its own way
☕ Iterating in reverse varies across collection types
☕ Needs operations for a sequence of elements with a
defined encounter order
//intersection of 2 lists of numbers
Set<Integer> intersection = new HashSet<>(list1);
intersection.retainAll(list2);
if (list1.get(0).equals(list2.get(0))) {
intersection.add(list1.get(0));
}
int last = list1.size() - 1;
if (list1.get(last)
.equals(list2.get(list2.size() - 1))) {
intersection.add(list1.get(last));
}
Enter SequencedCollections
public interface SequencedCollection<E>
extends Collection<E> {
SequencedCollection<E> reversed();
default void addFirst(E e);
default void addLast(E e);
default E getFirst();
default E getLast();
default E removeFirst();
default E removeLast();
}
☕ A Collection with a defined encounter order
☕ Has first and last elements
☕ Supports operations at either end
☕ Entries between first and last have successors and ancestors
☕ Can process elements forward and reverse
Refactoring to SequencedCollections
☕ A Collection with a defined encounter order
☕ Uniform access to first and last element
☕ Supports operations at either end
☕ Entries between first and last have successors and
ancestors
☕ Can process elements forward and reverse
//intersection of 2 lists of numbers
Set<Integer> intersection = new HashSet<>(list1);
intersection.retainAll(list2);
if (list1.getFirst().equals(list2.getFirst())) {
intersection.add(list1.getFirst());
}
if (list1.getLast().equals(list2.getLast())) {
intersection.add(list1.getLast());
}
So You Want To Know More…
☕ Inside Java Podcast Episode 31 “Sequenced Collections” with Stuart Marks
☕ Java 21's New (Sequenced) Collections - Inside Java Newscast #45
☕ Java 21 New Feature: Sequenced Collections - JEP Cafe #19
Performance Enhancements to
Achieve Your Application Goals
ZGC at a Glance
☕ Delivered in JDK 15 (September 2020)
☕ A scalable low-latency garbage collector
☕ Handling heap sizes from 8MB to 16TB
☕ Auto-tuning: requires minimal configuration
Pause Mark Start Pause Mark End Pause Relocate Start
Concurrent
Mark/Remap
Concurrent
Prepare for
Relocate
Concurrent
Relocate
GC Cycle
pauses are O(1)
Benefits of Generational ZGC
☕ Withstand higher allocation rates
☕ Lower heap headroom
☕ Lower CPU usage
☕ Starting with JDK 21 can be enabled using -XX:+UseZGC -XX:+ZGenerational
☕ Automatic Tuning - Only set the max heap size! (-Xmx)
Reduced latency in G1GC
☕ JNI includes critical accessor functions.
☕ The JVM must not move a Java thread that is in a critical region
☕ Lock an object in place as the GC moves other objects (pinning).
☕ JEP 423: Region Pinning for G1 targets JDK 22
Native Code
Functions
Libraries
JNI
GetPrimitiveArrayCritical
ReleasePrimitiveArrayCritical
Java Code
So You Want To Know More
☕ Introduction to ZGC
☕ Deep-dive of zgc's architecture
☕ JVMLS - generational ZGC and beyond
☕ Optimizing memory utilization with automated heap sizing in ZGC
☕ Z garbage collector: the next generation
☕ ZGC : java’s highly scalable low-latency garbage collector - stack walker #1
☕ Evacuation Failure and Object Pinning
Key Encapsulation Mechanism API
Secure Your Application Future Today
Security
Public Key Encryption (PKE)
☕ The sender encrypts a message using receiver's
public key .
☕ The receiver decrypts the message with their
private key.
☕ Brute force attacks on PKE data become practical
as quantum computing advances.
Key Encapsulation Mechanism (KEM)
☕ Generate a pair of keys (public, private).
☕ The sender creates an encapsulation using the public key.
☕ The sender uses KEM to transmit the shared key.
☕ Later the sender uses KEM to encrypt data
using
a symmetric algorithm.
☕ The receiver decrypts the encapsulation with its private key.
Key Encapsulation Mechanism API
☕ Key pair generation function
This function is already covered by the KeyPairGenerator API.
☕ Key encapsulation
Encapsulate(public_key) -> ciphertext, shared_secret
☕ Key decapsulation
Decapsulate(private_key, ciphertext) -> shared_secret
So You Want To Know More
☕ Java 21 Security #RoadTo21
☕ Strengthen your Java App's Defenses with Key Encapsulation Mechanism API - Inside Java Newscast #53
☕ JEP 452: Key Encapsulation Mechanism API
High Scale Applications Powered by a
Great Programming Model
Project Loom
Virtual Threads Under the Hood
A thread managed
by JVM scheduler
can get a task
assigned by you.
Java scheduler
assigns the virtual
thread to platform
thread(s).
Virtual thread asks platform
thread(s) to perform the task.
If a virtual thread has some blocking
I/O operation, it will be detached from
the platform thread.
Another virtual thread is assigned to the
platform thread so that the platform thread
stays in a running state
Readable Code with Virtual Threads
Create one new virtual thread per task
Explicitly start a virtual thread
Maintanable Code with Virtual Threads
Explicitly start a virtual thread
Execute 1000 tasks
Adoption
So you want to know more
☕ Virtual Threads: An Adoption Guide
☕ Java 21 new feature: Virtual Threads #RoadTo21
☕ JVMLS - The Challenges of Introducing Virtual Threads to the Java Platform by Alan Bateman
☕ JEP 444: Virtual Threads
Concurrent Programming without
Thread Leaks and Cancelation Delays
Project Loom
Structured Concurrency Advantages
try (var scope = new StructuredTaskScope.ShutdownOnSuccess<Present>()) {
var offer1 = scope.fork(() -> readOffer1(refPrice, boxPrice));
var offer2 = scope.fork(() -> readOffer2(refPrice, boxPrice));
var offer3 = scope.fork(() -> readOffer3(refPrice, boxPrice));
var offer4 = scope.fork(() -> readOffer4(refPrice, boxPrice));
scope.join();
Present quickPresent = scope.result();
return quickPresent;
} catch (ExecutionException | InterruptedException e) {
throw new RuntimeException(e);
}
Obtain a present fast from the available offers
☕ Create relationship between threads
☕ Forked tasks are children of the scope
☕ Success/failure policy can be defined across
all children.
Structured Concurrency Advantages
try (var scope = new StructuredTaskScope.ShutdownOnSuccess<Present>()) {
var offer1 = scope.fork(() -> readOffer1(refPrice, boxPrice));
var offer2 = scope.fork(() -> readOffer2(refPrice, boxPrice));
var offer3 = scope.fork(() -> readOffer3(refPrice, boxPrice));
var offer4 = scope.fork(() -> readOffer4(refPrice, boxPrice));
scope.join();
Present quickPresent = scope.result();
return quickPresent;
} catch (ExecutionException | InterruptedException e) {
throw new RuntimeException(e);
}
Obtain a present fast from the available offers
☕ Create relationship between threads
☕ Forked tasks are children of the scope
☕ Success/failure policy can be defined across
all children.
☕ Return the result of the first subtask that
completed with a result.
Structured Concurrency Advantages
try (var scope = new StructuredTaskScope.ShutdownOnSuccess<Present>()) {
var offer1 = scope.fork(() -> readOffer1(refPrice, boxPrice));
var offer2 = scope.fork(() -> readOffer2(refPrice, boxPrice));
var offer3 = scope.fork(() -> readOffer3(refPrice, boxPrice));
var offer4 = scope.fork(() -> readOffer4(refPrice, boxPrice));
scope.join();
Present quickPresent = scope.result();
return quickPresent;
} catch (ExecutionException | InterruptedException e) {
throw new RuntimeException(e);
}
Obtain a present fast from the available offers
☕ Create relationship between threads
☕ Forked tasks are children of the scope
☕ Success/failure policy can be defined across
all children.
☕ Return the result of the first subtask that
completed with a result.
☕ Thread-dumps capture transparently the
relationship between threads.
Benefits for High Scaling Applications
Higher throughput with fewer CPU
operations when having high number
concurrent requests.
When having blocking calls, virtual threads
will go in a waiting state until they receive
data.
Experience Scoped Values
//in Wrapup record
ScopedValue.where(VALID_REQUEST, Choice.EXPERIENCE)
.call(() -> findOffer(data.itemPrice()));
// in Experience record
public Experience {
if (!VALID_REQUEST.isBound()) {
throw new IllegalStateException("not bound");
} else if (!VALID_REQUEST.get()
.equals(Choice.EXPERIENCE)) {
throw new IllegalStateException(VALID_REQUEST.get());
}
}
//…
Find the best in price experience
☕ Best experience for a valid request
Experience Scoped Values
public static class ExperienceScope
extends StructuredTaskScope<Experience> {
//…
try (var scope = new Experience.ExperienceScope()) {
scope.fork(() -> readOffer1(referencePrice));
scope.fork(() -> readOffer2(referencePrice));
scope.fork(() -> readOffer3(referencePrice));
scope.fork(() -> readOffer4(referencePrice));
scope.join();
return scope.findOffer();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
//…
Find the best in price experience
☕ Best experience for a valid request
☕ Simplify reasoning about data flow
☕ The lifetime of shared data is visible from code
structure.
☕ Data shared by a caller can be retrieved only by
legitimate callees.
☕ Performance through immutable shared data.
So You Want To Know More
☕ Structured Concurrency
☕ On Parallelism and Concurrency
☕ Java 20 - From ThreadLocal to ScopedValue with Loom Full Tutorial - JEP Café #16
☕ JEP 453: Structured Concurrency (Preview)
☕ JEP 446: Scoped Values (Preview)
Exploring New Horizons
Project Leyden
☕ Faster Startup
Improving the time to get to the first useful unit of work.
☕ Better Warmup
Enhancing the time it takes for the application to reach peak performance.
☕ Provide a unifying conceptual model that lets developers choose how to trade off constraints for performance.
Improving Startup and Warmup
☕ Could shift computation work later in time, by utilizing laziness techniques.
☕ Could shift computation work earlier in time, from run time to build time.
☕ Shifting computation can be part of the application (e.g., running application or framework code), or on
behalf of the it (e.g., compiling application code).
☕ The JDK already has plenty of features that can shift computation.
Java Features that Can Shift Computation
☕ Using the normal semantics of Java programs
Compile-time constant folding (shifts earlier)
Garbage collection (later)
Lazy class loading and initialization (later)
☕ Some require the user to enable them
Experimental ahead-of-time (AOT) compilation (earlier)
Pre-digested class-data archives (CDS) (earlier)
Leyden conceptual model
Source https://openjdk.org/projects/leyden/slides/leyden-jvmls-2023-08-08.pdf
☕ Shift computation temporally, both later and earlier in time
☕ Constrain Java’s natural dynamism, if necessary to enable more and better shifting
☕ Selectively, per the needs of each particular program
☕ Compatibly, to preserve program meaning
Leyden progress
☕ Introduce condensers
Toward Condensers (design note, Brian Goetz, Mark Reinhold, & Paul Sandoz)
☕ Shift computation and constrain dynamism
Pre-generate lambda classes (prototype branch, Dan Heidinga)
Condensing Indy Bootstraps (design note, Brian Goetz)
Computed Constants (draft JEP, Per Ake Minborg & Maurizio Cimadamore)
Experiments in shifting speculative compilation (Rose et al.)
☕ Related improvements
Hermetic application packaging (prototype branch, Zhou)
JMOD-less linking (prototype, Gehwolf)
Source JVMLS - Project Leyden
Image by Placidplace from Pixabay
Project Babylon
☕ Extend Java's reach to foreign programming models.
☕ Code reflection is fit for purpose of GPU programming domains.
☕ Easily implement support for a foreign coding model as a Java library.
☕ API to build, analyze, and transform code models.
So you want to know more
☕ https://mail.openjdk.org/pipermail/discuss/2023-September/006226.html
☕ JVMLS - Java and GPU … are we nearly there yet?
☕ JVMLS Code Reflection by Paul Sandoz
☕ Java on GPU
Stay Tuned for More!
Inside.java
Dev.java youtube.com/java
Thank YOU!
Code

More Related Content

What's hot

Design pattern bridgepatern
Design pattern bridgepaternDesign pattern bridgepatern
Design pattern bridgepaternKombe Khalfan
 
La programmation modulaire en Python
La programmation modulaire en PythonLa programmation modulaire en Python
La programmation modulaire en PythonABDESSELAM ARROU
 
POO Java Introduction
POO Java IntroductionPOO Java Introduction
POO Java IntroductionMouna Torjmen
 
Design Patterns Java
Design Patterns JavaDesign Patterns Java
Design Patterns JavaVINOT Bernard
 
Introduction à Python - Achraf Kacimi El Hassani
Introduction à Python - Achraf Kacimi El HassaniIntroduction à Python - Achraf Kacimi El Hassani
Introduction à Python - Achraf Kacimi El HassaniShellmates
 
Cours les Listes doublement chainées Prof. KHALIFA MANSOURI
Cours les Listes doublement chainées Prof. KHALIFA MANSOURI Cours les Listes doublement chainées Prof. KHALIFA MANSOURI
Cours les Listes doublement chainées Prof. KHALIFA MANSOURI Mansouri Khalifa
 
POO Java Chapitre 6 Exceptions
POO Java  Chapitre 6 ExceptionsPOO Java  Chapitre 6 Exceptions
POO Java Chapitre 6 ExceptionsMouna Torjmen
 
Examen principal - Algorithme & Structures de données
Examen principal - Algorithme & Structures de donnéesExamen principal - Algorithme & Structures de données
Examen principal - Algorithme & Structures de donnéesInes Ouaz
 
Correction de td poo n2
Correction de td poo n2Correction de td poo n2
Correction de td poo n2yassine kchiri
 
Chapitre8: Collections et Enumerations En Java
Chapitre8: Collections et Enumerations En JavaChapitre8: Collections et Enumerations En Java
Chapitre8: Collections et Enumerations En JavaAziz Darouichi
 
Binary Tree in Data Structure
Binary Tree in Data StructureBinary Tree in Data Structure
Binary Tree in Data StructureMeghaj Mallick
 
Insertion into linked lists
Insertion into linked lists Insertion into linked lists
Insertion into linked lists MrDavinderSingh
 
Présentation de RMI Java
Présentation de RMI JavaPrésentation de RMI Java
Présentation de RMI JavaZakaria Bouazza
 
Yzm 2116 Bölüm 7 - Tree ve Binary tree - İkili Ağaç
Yzm 2116  Bölüm 7 - Tree  ve Binary tree - İkili AğaçYzm 2116  Bölüm 7 - Tree  ve Binary tree - İkili Ağaç
Yzm 2116 Bölüm 7 - Tree ve Binary tree - İkili AğaçDeniz KILINÇ
 
Big data: NoSQL comme solution
Big data: NoSQL comme solutionBig data: NoSQL comme solution
Big data: NoSQL comme solutionJEMLI Fathi
 
POO Java Chapitre 1 Classe & Objet
POO Java Chapitre 1 Classe & ObjetPOO Java Chapitre 1 Classe & Objet
POO Java Chapitre 1 Classe & ObjetMouna Torjmen
 

What's hot (20)

Design pattern bridgepatern
Design pattern bridgepaternDesign pattern bridgepatern
Design pattern bridgepatern
 
La programmation modulaire en Python
La programmation modulaire en PythonLa programmation modulaire en Python
La programmation modulaire en Python
 
POO Java Introduction
POO Java IntroductionPOO Java Introduction
POO Java Introduction
 
Design Patterns Java
Design Patterns JavaDesign Patterns Java
Design Patterns Java
 
Introduction à Python - Achraf Kacimi El Hassani
Introduction à Python - Achraf Kacimi El HassaniIntroduction à Python - Achraf Kacimi El Hassani
Introduction à Python - Achraf Kacimi El Hassani
 
Cours les Listes doublement chainées Prof. KHALIFA MANSOURI
Cours les Listes doublement chainées Prof. KHALIFA MANSOURI Cours les Listes doublement chainées Prof. KHALIFA MANSOURI
Cours les Listes doublement chainées Prof. KHALIFA MANSOURI
 
POO Java Chapitre 6 Exceptions
POO Java  Chapitre 6 ExceptionsPOO Java  Chapitre 6 Exceptions
POO Java Chapitre 6 Exceptions
 
Examen principal - Algorithme & Structures de données
Examen principal - Algorithme & Structures de donnéesExamen principal - Algorithme & Structures de données
Examen principal - Algorithme & Structures de données
 
Correction de td poo n2
Correction de td poo n2Correction de td poo n2
Correction de td poo n2
 
Chapitre8: Collections et Enumerations En Java
Chapitre8: Collections et Enumerations En JavaChapitre8: Collections et Enumerations En Java
Chapitre8: Collections et Enumerations En Java
 
Binary Tree in Data Structure
Binary Tree in Data StructureBinary Tree in Data Structure
Binary Tree in Data Structure
 
Cours JavaScript
Cours JavaScriptCours JavaScript
Cours JavaScript
 
Insertion into linked lists
Insertion into linked lists Insertion into linked lists
Insertion into linked lists
 
Support programmation orientée objet c# .net version f8
Support programmation orientée objet c#  .net version f8Support programmation orientée objet c#  .net version f8
Support programmation orientée objet c# .net version f8
 
HTML, CSS et Javascript
HTML, CSS et JavascriptHTML, CSS et Javascript
HTML, CSS et Javascript
 
Langage C#
Langage C#Langage C#
Langage C#
 
Présentation de RMI Java
Présentation de RMI JavaPrésentation de RMI Java
Présentation de RMI Java
 
Yzm 2116 Bölüm 7 - Tree ve Binary tree - İkili Ağaç
Yzm 2116  Bölüm 7 - Tree  ve Binary tree - İkili AğaçYzm 2116  Bölüm 7 - Tree  ve Binary tree - İkili Ağaç
Yzm 2116 Bölüm 7 - Tree ve Binary tree - İkili Ağaç
 
Big data: NoSQL comme solution
Big data: NoSQL comme solutionBig data: NoSQL comme solution
Big data: NoSQL comme solution
 
POO Java Chapitre 1 Classe & Objet
POO Java Chapitre 1 Classe & ObjetPOO Java Chapitre 1 Classe & Objet
POO Java Chapitre 1 Classe & Objet
 

Similar to Java 21 and Beyond- A Roadmap of Innovations

Java 21 Language Features and Beyond
Java 21 Language Features and BeyondJava 21 Language Features and Beyond
Java 21 Language Features and BeyondAna-Maria Mihalceanu
 
ES6 Everywhere – Adam Klein
ES6 Everywhere – Adam KleinES6 Everywhere – Adam Klein
ES6 Everywhere – Adam Klein500Tech
 
Es6 everywhere
Es6 everywhereEs6 everywhere
Es6 everywhereAdam Klein
 
CoffeeScript Design Patterns
CoffeeScript Design PatternsCoffeeScript Design Patterns
CoffeeScript Design PatternsTrevorBurnham
 
AST - the only true tool for building JavaScript
AST - the only true tool for building JavaScriptAST - the only true tool for building JavaScript
AST - the only true tool for building JavaScriptIngvar Stepanyan
 
Jakarta EE Recipes
Jakarta EE RecipesJakarta EE Recipes
Jakarta EE RecipesJosh Juneau
 
SproutCore and the Future of Web Apps
SproutCore and the Future of Web AppsSproutCore and the Future of Web Apps
SproutCore and the Future of Web AppsMike Subelsky
 
Big Data Processing with .NET and Spark (SQLBits 2020)
Big Data Processing with .NET and Spark (SQLBits 2020)Big Data Processing with .NET and Spark (SQLBits 2020)
Big Data Processing with .NET and Spark (SQLBits 2020)Michael Rys
 
BOF2644 Developing Java EE 7 Scala apps
BOF2644 Developing Java EE 7 Scala appsBOF2644 Developing Java EE 7 Scala apps
BOF2644 Developing Java EE 7 Scala appsPeter Pilgrim
 
Visualizing Web Data Query Results
Visualizing Web Data Query ResultsVisualizing Web Data Query Results
Visualizing Web Data Query ResultsAnja Jentzsch
 
WWW2012 Tutorial Visualizing SPARQL Queries
WWW2012 Tutorial Visualizing SPARQL QueriesWWW2012 Tutorial Visualizing SPARQL Queries
WWW2012 Tutorial Visualizing SPARQL QueriesPablo Mendes
 
GCPUG meetup 201610 - Dataflow Introduction
GCPUG meetup 201610 - Dataflow IntroductionGCPUG meetup 201610 - Dataflow Introduction
GCPUG meetup 201610 - Dataflow IntroductionSimon Su
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryTatsuhiko Miyagawa
 
Bhadale Group of Companies - digital projects
Bhadale Group of Companies - digital projectsBhadale Group of Companies - digital projects
Bhadale Group of Companies - digital projectsVijayananda Mohire
 

Similar to Java 21 and Beyond- A Roadmap of Innovations (20)

Java 21 Language Features and Beyond
Java 21 Language Features and BeyondJava 21 Language Features and Beyond
Java 21 Language Features and Beyond
 
ES6 Everywhere – Adam Klein
ES6 Everywhere – Adam KleinES6 Everywhere – Adam Klein
ES6 Everywhere – Adam Klein
 
Es6 everywhere
Es6 everywhereEs6 everywhere
Es6 everywhere
 
CoffeeScript Design Patterns
CoffeeScript Design PatternsCoffeeScript Design Patterns
CoffeeScript Design Patterns
 
Python, WebRTC and You (v2)
Python, WebRTC and You (v2)Python, WebRTC and You (v2)
Python, WebRTC and You (v2)
 
Nodejs meetup-12-2-2015
Nodejs meetup-12-2-2015Nodejs meetup-12-2-2015
Nodejs meetup-12-2-2015
 
Javascript status 2016
Javascript status 2016Javascript status 2016
Javascript status 2016
 
AST - the only true tool for building JavaScript
AST - the only true tool for building JavaScriptAST - the only true tool for building JavaScript
AST - the only true tool for building JavaScript
 
Jakarta EE Recipes
Jakarta EE RecipesJakarta EE Recipes
Jakarta EE Recipes
 
SproutCore and the Future of Web Apps
SproutCore and the Future of Web AppsSproutCore and the Future of Web Apps
SproutCore and the Future of Web Apps
 
Big Data Processing with .NET and Spark (SQLBits 2020)
Big Data Processing with .NET and Spark (SQLBits 2020)Big Data Processing with .NET and Spark (SQLBits 2020)
Big Data Processing with .NET and Spark (SQLBits 2020)
 
BOF2644 Developing Java EE 7 Scala apps
BOF2644 Developing Java EE 7 Scala appsBOF2644 Developing Java EE 7 Scala apps
BOF2644 Developing Java EE 7 Scala apps
 
Visualizing Web Data Query Results
Visualizing Web Data Query ResultsVisualizing Web Data Query Results
Visualizing Web Data Query Results
 
WWW2012 Tutorial Visualizing SPARQL Queries
WWW2012 Tutorial Visualizing SPARQL QueriesWWW2012 Tutorial Visualizing SPARQL Queries
WWW2012 Tutorial Visualizing SPARQL Queries
 
GCPUG meetup 201610 - Dataflow Introduction
GCPUG meetup 201610 - Dataflow IntroductionGCPUG meetup 201610 - Dataflow Introduction
GCPUG meetup 201610 - Dataflow Introduction
 
Vidoop CouchDB Talk
Vidoop CouchDB TalkVidoop CouchDB Talk
Vidoop CouchDB Talk
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
 
Bhadale Group of Companies - digital projects
Bhadale Group of Companies - digital projectsBhadale Group of Companies - digital projects
Bhadale Group of Companies - digital projects
 
OO in JavaScript
OO in JavaScriptOO in JavaScript
OO in JavaScript
 
Java Script Best Practices
Java Script Best PracticesJava Script Best Practices
Java Script Best Practices
 

More from Ana-Maria Mihalceanu

Surveillance de la sécurité des applications Java avec les outils du JDK e...
Surveillance de la sécurité des applications Java  avec les outils du JDK e...Surveillance de la sécurité des applications Java  avec les outils du JDK e...
Surveillance de la sécurité des applications Java avec les outils du JDK e...Ana-Maria Mihalceanu
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
Monitoring Java Application Security with JDK Tools and JFR Events.pdf
Monitoring Java Application Security with JDK Tools and JFR Events.pdfMonitoring Java Application Security with JDK Tools and JFR Events.pdf
Monitoring Java Application Security with JDK Tools and JFR Events.pdfAna-Maria Mihalceanu
 
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17
Enhancing Productivity and Insight  A Tour of JDK Tools Progress Beyond Java 17Enhancing Productivity and Insight  A Tour of JDK Tools Progress Beyond Java 17
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17Ana-Maria Mihalceanu
 
From Java 17 to 21- A Showcase of JDK Security Enhancements
From Java 17 to 21- A Showcase of JDK Security EnhancementsFrom Java 17 to 21- A Showcase of JDK Security Enhancements
From Java 17 to 21- A Showcase of JDK Security EnhancementsAna-Maria Mihalceanu
 
A Glance At The Java Performance Toolbox
 A Glance At The Java Performance Toolbox A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
A Glance At The Java Performance Toolbox.pdf
 A Glance At The Java Performance Toolbox.pdf A Glance At The Java Performance Toolbox.pdf
A Glance At The Java Performance Toolbox.pdfAna-Maria Mihalceanu
 
A Glance At The Java Performance Toolbox-TIA.pdf
 A Glance At The Java Performance Toolbox-TIA.pdf A Glance At The Java Performance Toolbox-TIA.pdf
A Glance At The Java Performance Toolbox-TIA.pdfAna-Maria Mihalceanu
 
A Glance At The Java Performance Toolbox.pdf
 A Glance At The Java Performance Toolbox.pdf A Glance At The Java Performance Toolbox.pdf
A Glance At The Java Performance Toolbox.pdfAna-Maria Mihalceanu
 
A Glance At The Java Performance Toolbox.pdf
 A Glance At The Java Performance Toolbox.pdf A Glance At The Java Performance Toolbox.pdf
A Glance At The Java Performance Toolbox.pdfAna-Maria Mihalceanu
 
How Java 19 Influences the Future of Your High-Scale Applications .pdf
How Java 19 Influences the Future of Your High-Scale Applications .pdfHow Java 19 Influences the Future of Your High-Scale Applications .pdf
How Java 19 Influences the Future of Your High-Scale Applications .pdfAna-Maria Mihalceanu
 
The Automation Challenge Kubernetes Operators vs Helm Charts.pdf
The Automation Challenge Kubernetes Operators vs Helm Charts.pdfThe Automation Challenge Kubernetes Operators vs Helm Charts.pdf
The Automation Challenge Kubernetes Operators vs Helm Charts.pdfAna-Maria Mihalceanu
 
Cloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upCloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upAna-Maria Mihalceanu
 
Cloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upCloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upAna-Maria Mihalceanu
 
Cloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upCloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upAna-Maria Mihalceanu
 
The automation challenge Kubernetes operators vs Helm charts
The automation challenge Kubernetes operators vs Helm chartsThe automation challenge Kubernetes operators vs Helm charts
The automation challenge Kubernetes operators vs Helm chartsAna-Maria Mihalceanu
 
Cloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upCloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upAna-Maria Mihalceanu
 
DevoxxUK 2021 Techniques for maintainable Quarkus applications
DevoxxUK 2021 Techniques for maintainable Quarkus applicationsDevoxxUK 2021 Techniques for maintainable Quarkus applications
DevoxxUK 2021 Techniques for maintainable Quarkus applicationsAna-Maria Mihalceanu
 
The automation challenge: Kubernetes Operators vs Helm Charts
The automation challenge: Kubernetes Operators vs Helm ChartsThe automation challenge: Kubernetes Operators vs Helm Charts
The automation challenge: Kubernetes Operators vs Helm ChartsAna-Maria Mihalceanu
 

More from Ana-Maria Mihalceanu (20)

Surveillance de la sécurité des applications Java avec les outils du JDK e...
Surveillance de la sécurité des applications Java  avec les outils du JDK e...Surveillance de la sécurité des applications Java  avec les outils du JDK e...
Surveillance de la sécurité des applications Java avec les outils du JDK e...
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
Monitoring Java Application Security with JDK Tools and JFR Events.pdf
Monitoring Java Application Security with JDK Tools and JFR Events.pdfMonitoring Java Application Security with JDK Tools and JFR Events.pdf
Monitoring Java Application Security with JDK Tools and JFR Events.pdf
 
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17
Enhancing Productivity and Insight  A Tour of JDK Tools Progress Beyond Java 17Enhancing Productivity and Insight  A Tour of JDK Tools Progress Beyond Java 17
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17
 
From Java 17 to 21- A Showcase of JDK Security Enhancements
From Java 17 to 21- A Showcase of JDK Security EnhancementsFrom Java 17 to 21- A Showcase of JDK Security Enhancements
From Java 17 to 21- A Showcase of JDK Security Enhancements
 
A Glance At The Java Performance Toolbox
 A Glance At The Java Performance Toolbox A Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
A Glance At The Java Performance Toolbox.pdf
 A Glance At The Java Performance Toolbox.pdf A Glance At The Java Performance Toolbox.pdf
A Glance At The Java Performance Toolbox.pdf
 
A Glance At The Java Performance Toolbox-TIA.pdf
 A Glance At The Java Performance Toolbox-TIA.pdf A Glance At The Java Performance Toolbox-TIA.pdf
A Glance At The Java Performance Toolbox-TIA.pdf
 
A Glance At The Java Performance Toolbox.pdf
 A Glance At The Java Performance Toolbox.pdf A Glance At The Java Performance Toolbox.pdf
A Glance At The Java Performance Toolbox.pdf
 
A Glance At The Java Performance Toolbox.pdf
 A Glance At The Java Performance Toolbox.pdf A Glance At The Java Performance Toolbox.pdf
A Glance At The Java Performance Toolbox.pdf
 
How Java 19 Influences the Future of Your High-Scale Applications .pdf
How Java 19 Influences the Future of Your High-Scale Applications .pdfHow Java 19 Influences the Future of Your High-Scale Applications .pdf
How Java 19 Influences the Future of Your High-Scale Applications .pdf
 
The Automation Challenge Kubernetes Operators vs Helm Charts.pdf
The Automation Challenge Kubernetes Operators vs Helm Charts.pdfThe Automation Challenge Kubernetes Operators vs Helm Charts.pdf
The Automation Challenge Kubernetes Operators vs Helm Charts.pdf
 
Exploring Quarkus on JDK 17
Exploring Quarkus on JDK 17Exploring Quarkus on JDK 17
Exploring Quarkus on JDK 17
 
Cloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upCloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground up
 
Cloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upCloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground up
 
Cloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upCloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground up
 
The automation challenge Kubernetes operators vs Helm charts
The automation challenge Kubernetes operators vs Helm chartsThe automation challenge Kubernetes operators vs Helm charts
The automation challenge Kubernetes operators vs Helm charts
 
Cloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upCloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground up
 
DevoxxUK 2021 Techniques for maintainable Quarkus applications
DevoxxUK 2021 Techniques for maintainable Quarkus applicationsDevoxxUK 2021 Techniques for maintainable Quarkus applications
DevoxxUK 2021 Techniques for maintainable Quarkus applications
 
The automation challenge: Kubernetes Operators vs Helm Charts
The automation challenge: Kubernetes Operators vs Helm ChartsThe automation challenge: Kubernetes Operators vs Helm Charts
The automation challenge: Kubernetes Operators vs Helm Charts
 

Recently uploaded

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Recently uploaded (20)

Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

Java 21 and Beyond- A Roadmap of Innovations

  • 1. Java 21 and Beyond A Roadmap of Innovations
  • 2. Java Champion Alumni, Certified Architect Senior Developer Advocate at Oracle Passionate about solving complex scenarios involving Java and Kubernetes. ammbra1508 ammbra1508.mastodon.social
  • 3. “The only way you can predict the future is to build it” Alan Kay Download and give it try: https://jdk.java.net/21/
  • 4. 6-Month Release Cadence Sept 2017 Mar 2018 Sept 2018 Mar 2019 Sept 2019 Mar 2020 Sept 2020 Mar 2021 Sept 2021 Mar 2014 3 + Years 6 Months 6 Months 6 Months 6 Months 6 Months 6 Months 6 Months 6 Months JDK 8 JDK 9 JDK 10 JDK 11 JDK 12 JDK 13 JDK 14 JDK 15 JDK 16 JDK 17 JDK 18 Mar 2022 6 Months JDK 19 Sept 2022 6 Months JDK 20 JDK 21 Mar 2023 Sept 2023 Commercial Support Commercial Support Commercial Support Commercial Support 6 Months 6 Months
  • 5. Innovating for the Future Panama Improving and enriching the connections between the Java virtual machine and well-defined but “foreign” (non-Java) APIs Valhalla Higher density and performance of machine learning and big data applications through the introduction of inline classes. Loom Massively scale lightweight threads, making concurrency simple again. Amber Continuously improve developer productivity through evolutions of the Java language. Leyden Address long-term pain points of Java’s start-up time, time to peak performance and large footprint. ZGC Create a scalable low latency garbage collector capable of handling large heaps. openjdk.org
  • 6. A Minimal Java Setup public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } } ☕ A JDK (includes JDK tools like javac and java) ☕ An Integrated Development Environment (IDE) ☕ A build tool (maven, gradle, basel etc) ☕ (Boilerplate) Java code
  • 7. Towards a Simplified Beginning ☕ Use jshell for fast prototyping Java code ☕ Since JDK 11 you have single-file execution java HelloWorld.java public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }
  • 8. Towards a Simplified Beginning ☕ Use jshell for fast prototyping Java code ☕ Since JDK 11 you have single-file execution java HelloWorld.java ☕ JEP 458 proposes the ability to run a program supplied as multiple files of Java code java --class-path ‘*’ HelloWorld.java // HelloWorld.java class HelloWorld { public static void main(String[] args) { Helper.run(); } } // Helper.java class Helper { static void run() { System.out.println("Hello World!"); } }
  • 10. Effective Scripting with Java // HelloWorld.java void main() { Helper.run(); } // Helper.java class Helper { static void run() { System.out.println("Hello World!"); } } JEP 445 proposes to reduce mandatory Java concepts ☕ Class declaration no longer required ☕ main is not necessarily public static ☕ String[] args not declared if not used further
  • 11. Invocation Order When Selecting Main ☕ A static void main(String[] args) method of non-private access in the launched class. ☕ A static void main() method with non-private access in the launched class. ☕ A non-private void main(String[] args) instance method in the launched class/inherited from a superclass. ☕ A non-private void main() instance method in the launched class or inherited from a superclass.
  • 12. So You Want to Know More… ☕ JEP 445:Unnamed Classes and Instance Main Methods(Preview) ☕ JEP 463: Implicitly Declared Classes and Instance Main Methods (Second Preview) ☕ Script Java Easily in 21 and Beyond - Inside Java Newscast #49 ☕ JEP 458: Launch Multi-File Source-Code Programs
  • 13. Record Patterns Less Boilerplate, More Fun Project Amber
  • 14. Express Semantic Intent of Your Models // Prior to Java 16 if (obj instanceof Postcard) { Postcard p = (Postcard)obj; ... use p ... } // As of Java 16 if (obj instanceof Postcard p) { ... use p ... }
  • 15. Pattern Matching and Records Intention intention = new Present(24.2, 1.5, “RON”); // As of Java 16 if (intention instanceof Present p) { double itemPrice = p.itemPrice(); double boxPrice = p.boxPrice(); System.out.println(itemPrice + boxPrice); } // As of Java 21 if (intention instanceof Present(double itemPrice, double boxPrice, Currency c)) { System.out.println(itemPrice + boxPrice); }
  • 16. Wrapup Expressive Data Modeling ☕ A sender can do a nice gesture and offer a gift. ☕ A gift can be either a postcard or add to it one of the following: an online coupon, buy an experience or a material present. ☕ A postcard does not have an associated cost, all the other 3 types of gifts have a price. ☕ An online coupon has an expiry date. ☕ A present can be placed inside a box. ☕ A sender can give a different postcard or surprise depending on celebration, but never send 2 postcards as a gift.
  • 17. Wrapup Expressive Data Modeling ☕ A common formatting process to JSON through public sealed interface Intention permits Coupon, Experience, Present, Postcard { //… }
  • 18. Wrapup Expressive Data Modeling ☕ A common formatting process to JSON through public sealed interface Intention permits Coupon, Experience, Present, Postcard { //… } ☕ Coupon, Experience, Present, Postcard are records ☕ Represent Gift using nested record patterns
  • 19. Working With Nested Record Patterns public record Postcard(String sender, String receiver, Celebration celebration) implements Intention{} public record Experience(double price, Currency currency)implements Intention{} record Gift(Postcard postcard, Intention intention) {} // As of Java 21 if (gift instanceof Gift(Postcard p, Experience e)) { System.out.println("Price of experience is expressed in" + e.currency()) }
  • 20. Working With Nested Record Patterns public record Postcard(String sender, String receiver, Celebration celebration) implements Intention{} public record Experience(double price, Currency currency)implements Intention{} record Gift(Postcard postcard, Intention intention) {} // As of Java 21 if (gift instanceof Gift(Postcard p, Experience (double price, Currency c ))) { System.out.println("Price of experience is expressed in" + c); }
  • 21. Working With Nested Record Patterns public record Postcard(String sender, String receiver, Celebration celebration) implements Intention{} public record Experience(double price, Currency currency)implements Intention{} record Gift(Postcard postcard, Intention intention) {} // As of Java 21 if (gift instanceof Gift(var p, Experience (var price, Currency c ))) { System.out.println("Price of experience is expressed in" + c); }
  • 22. So You Want To Know More… ☕ Clean Application Development with Records, Sealed Classes and Pattern Matching (2022) ☕ Java Records are "Trusted" and Consequently Faster ☕ Java 21 New Feature: Sequenced Collections - JEP Cafe #19 ☕ JEP 440:Record Patterns
  • 23. String Templates A Match Made in Java Heaven Project Amber
  • 24. String Templates Components String data = STR. """ { "sender": "Ana", "receiver": "Duke", "celebration": "{ celebration}", "option" : "{ Choice.NONE }" } """ ; ☕ A template processor (STR), ☕ A dot character (U+002E), ☕ A template which can contain an embedded expression ({celebration}).
  • 25. Use the Template Processor API package java.lang; public interface StringTemplate { ... @FunctionalInterface public interface Processor<R, E extends Throwable> { R process(StringTemplate st) throws E; } ... }
  • 26. Use the Template Processor API public interface StringTemplate { ... @FunctionalInterface public interface Processor<R, E extends Throwable> { R process(StringTemplate st) throws E; } ... } public sealed interface Intention permits Coupon, Experience, Present, Postcard { StringTemplate.Processor<JSONObject, RuntimeException> JSON = StringTemplate.Processor.of( (StringTemplate st) -> new JSONObject(st.interpolate()) ); JSONObject asJSON(); }
  • 27. Use the Template Processor API public record Present(double itemPrice, double boxPrice, Currency currency) implements Intention { @Override public JSONObject asJSON() { return JSON. """ { "currency": "{currency}", "boxPrice": "{boxPrice}", "packaged" : "{ boxPrice > 0.0}", "cost": "{(boxPrice > 0.0) ? itemPrice + boxPrice : itemPrice}" }; """ ; } }
  • 28. Use the Template Processor API public record Present(double itemPrice, double boxPrice, Currency currency) implements Intention { @Override public JSONObject asJSON() { return JSON. """ { "currency": "{currency}", "boxPrice": "{boxPrice}", "packaged" : "{ boxPrice > 0.0}", "cost": "{(boxPrice > 0.0) ? itemPrice + boxPrice : itemPrice}" }; """ ; } }
  • 29. Use the Template Processor API public record Present(double itemPrice, double boxPrice, Currency currency) implements Intention { @Override public JSONObject asJSON() { return JSON. """ { "currency": "{currency}", "boxPrice": "{boxPrice}", "packaged" : "{ boxPrice > 0.0}", "cost": "{(boxPrice > 0.0) ? itemPrice + boxPrice : itemPrice}" }; """ ; } }
  • 30. So You Want to Know More… ☕ Interpolate Strings Like a King in Java 21 - Inside Java Newscast #47 ☕ String Tapas Redux by Jim Laskey and Brian Goetz ☕ JEP 430: String Templates (Preview) ☕ JEP 459: String Templates (Second Preview) ☕ Stepping in 2024 with Powerful Java Language Features
  • 31. Attain Code Clarity with Pattern Matching for Switch Project Amber
  • 32. Many Flavors Of Pattern Matching & Switch ☕ Test the equality of a variable against several values specified in the cases ☕ More expressiveness and utility of switch expressions ☕ Mitigate the strict null-handling behavior of switch ☕ Augment security of switch statements ☕ Guarantee backward compatibility for all existing switch expressions and statements
  • 33. Let’s Add Some Style to Postcard Font font = postcard.celebration().getStyle(); switch(font) { case Style s when s == Style.BOLD -> { System.out.println("It's bold"); } case Style s when s == Style.REGULAR -> { System.out.println("It's regular"); } case Style s -> System.out.println("Other styles"); case Color c -> System.out.println("It's colored"); } Since JDK 21 ☕ No more parenthesized patterns ☕ Qualified enum constants can be case constants in switch expressions and statements.
  • 34. Record Patterns and Exhaustive Switch JSONObject process(Gift gift, Choice choice) { return switch (gift) { case Gift(Postcard p, Postcard p2) -> p.asJSON(); case Gift(Postcard p, Coupon c) when (c.price() == 0.0) -> p.asJSON(); case Gift(Postcard p, Experience e) when (e.price() == 0.0) -> p.asJSON(); case Gift(Postcard p, Present pr) when (pr.itemPrice() == 0.0) -> p.asJSON(); case Gift(Postcard p, Experience e) -> gift.merge(choice.name().toLowerCase()); case Gift(Postcard p, Present pr) -> gift.merge(choice.name().toLowerCase()); case Gift(Postcard p, Coupon c) -> gift.merge(choice.name().toLowerCase()); }; }
  • 35. So You Want To Know More… ☕ State of Pattern Matching with Brian Goetz (2022) ☕ Pattern Matching in the Java Object Model ☕ Patterns: Exhaustiveness, Unconditionality, and Remainder ☕ JEP 441: Pattern Matching for switch ☕ Uniform handling of failure in switch
  • 36. Unnamed Patterns and Variables to Improve Code Maintainability Project Amber
  • 37. Code Readability and Lower Error Chances JSONObject process(Gift gift, Choice choice) { return switch (gift) { case Gift(Postcard p, Postcard _) -> p.asJSON(); case Gift(Postcard p, Coupon c) when (c.price() == 0.0) -> p.asJSON(); case Gift(Postcard p, Experience e) when (e.price() == 0.0) -> p.asJSON(); case Gift(Postcard p, Present pr) when (pr.itemPrice() == 0.0) -> p.asJSON(); case Gift(_, Coupon _), Gift(_, Experience _), Gift(_, Present _) -> { String option = choice.name().toLowerCase(); yield gift.merge(option); } }; }
  • 38. Image by geralt from Pixabay
  • 39. SequencedCollections From First to Last and Everything Reversed JEP 431: Sequenced Collections: https://openjdk.org/jeps/431 Core Library
  • 40. A World Without SequencedCollections ☕ Each collection gets first and last element in its own way ☕ Iterating in reverse varies across collection types ☕ Needs operations for a sequence of elements with a defined encounter order //intersection of 2 lists of numbers Set<Integer> intersection = new HashSet<>(list1); intersection.retainAll(list2); if (list1.get(0).equals(list2.get(0))) { intersection.add(list1.get(0)); } int last = list1.size() - 1; if (list1.get(last) .equals(list2.get(list2.size() - 1))) { intersection.add(list1.get(last)); }
  • 41. Enter SequencedCollections public interface SequencedCollection<E> extends Collection<E> { SequencedCollection<E> reversed(); default void addFirst(E e); default void addLast(E e); default E getFirst(); default E getLast(); default E removeFirst(); default E removeLast(); } ☕ A Collection with a defined encounter order ☕ Has first and last elements ☕ Supports operations at either end ☕ Entries between first and last have successors and ancestors ☕ Can process elements forward and reverse
  • 42. Refactoring to SequencedCollections ☕ A Collection with a defined encounter order ☕ Uniform access to first and last element ☕ Supports operations at either end ☕ Entries between first and last have successors and ancestors ☕ Can process elements forward and reverse //intersection of 2 lists of numbers Set<Integer> intersection = new HashSet<>(list1); intersection.retainAll(list2); if (list1.getFirst().equals(list2.getFirst())) { intersection.add(list1.getFirst()); } if (list1.getLast().equals(list2.getLast())) { intersection.add(list1.getLast()); }
  • 43. So You Want To Know More… ☕ Inside Java Podcast Episode 31 “Sequenced Collections” with Stuart Marks ☕ Java 21's New (Sequenced) Collections - Inside Java Newscast #45 ☕ Java 21 New Feature: Sequenced Collections - JEP Cafe #19
  • 44. Performance Enhancements to Achieve Your Application Goals
  • 45. ZGC at a Glance ☕ Delivered in JDK 15 (September 2020) ☕ A scalable low-latency garbage collector ☕ Handling heap sizes from 8MB to 16TB ☕ Auto-tuning: requires minimal configuration Pause Mark Start Pause Mark End Pause Relocate Start Concurrent Mark/Remap Concurrent Prepare for Relocate Concurrent Relocate GC Cycle pauses are O(1)
  • 46. Benefits of Generational ZGC ☕ Withstand higher allocation rates ☕ Lower heap headroom ☕ Lower CPU usage ☕ Starting with JDK 21 can be enabled using -XX:+UseZGC -XX:+ZGenerational ☕ Automatic Tuning - Only set the max heap size! (-Xmx)
  • 47. Reduced latency in G1GC ☕ JNI includes critical accessor functions. ☕ The JVM must not move a Java thread that is in a critical region ☕ Lock an object in place as the GC moves other objects (pinning). ☕ JEP 423: Region Pinning for G1 targets JDK 22 Native Code Functions Libraries JNI GetPrimitiveArrayCritical ReleasePrimitiveArrayCritical Java Code
  • 48. So You Want To Know More ☕ Introduction to ZGC ☕ Deep-dive of zgc's architecture ☕ JVMLS - generational ZGC and beyond ☕ Optimizing memory utilization with automated heap sizing in ZGC ☕ Z garbage collector: the next generation ☕ ZGC : java’s highly scalable low-latency garbage collector - stack walker #1 ☕ Evacuation Failure and Object Pinning
  • 49. Key Encapsulation Mechanism API Secure Your Application Future Today Security
  • 50. Public Key Encryption (PKE) ☕ The sender encrypts a message using receiver's public key . ☕ The receiver decrypts the message with their private key. ☕ Brute force attacks on PKE data become practical as quantum computing advances.
  • 51. Key Encapsulation Mechanism (KEM) ☕ Generate a pair of keys (public, private). ☕ The sender creates an encapsulation using the public key. ☕ The sender uses KEM to transmit the shared key. ☕ Later the sender uses KEM to encrypt data using a symmetric algorithm. ☕ The receiver decrypts the encapsulation with its private key.
  • 52. Key Encapsulation Mechanism API ☕ Key pair generation function This function is already covered by the KeyPairGenerator API. ☕ Key encapsulation Encapsulate(public_key) -> ciphertext, shared_secret ☕ Key decapsulation Decapsulate(private_key, ciphertext) -> shared_secret
  • 53. So You Want To Know More ☕ Java 21 Security #RoadTo21 ☕ Strengthen your Java App's Defenses with Key Encapsulation Mechanism API - Inside Java Newscast #53 ☕ JEP 452: Key Encapsulation Mechanism API
  • 54. High Scale Applications Powered by a Great Programming Model Project Loom
  • 55. Virtual Threads Under the Hood A thread managed by JVM scheduler can get a task assigned by you. Java scheduler assigns the virtual thread to platform thread(s). Virtual thread asks platform thread(s) to perform the task. If a virtual thread has some blocking I/O operation, it will be detached from the platform thread. Another virtual thread is assigned to the platform thread so that the platform thread stays in a running state
  • 56. Readable Code with Virtual Threads Create one new virtual thread per task Explicitly start a virtual thread
  • 57. Maintanable Code with Virtual Threads Explicitly start a virtual thread Execute 1000 tasks
  • 59. So you want to know more ☕ Virtual Threads: An Adoption Guide ☕ Java 21 new feature: Virtual Threads #RoadTo21 ☕ JVMLS - The Challenges of Introducing Virtual Threads to the Java Platform by Alan Bateman ☕ JEP 444: Virtual Threads
  • 60. Concurrent Programming without Thread Leaks and Cancelation Delays Project Loom
  • 61. Structured Concurrency Advantages try (var scope = new StructuredTaskScope.ShutdownOnSuccess<Present>()) { var offer1 = scope.fork(() -> readOffer1(refPrice, boxPrice)); var offer2 = scope.fork(() -> readOffer2(refPrice, boxPrice)); var offer3 = scope.fork(() -> readOffer3(refPrice, boxPrice)); var offer4 = scope.fork(() -> readOffer4(refPrice, boxPrice)); scope.join(); Present quickPresent = scope.result(); return quickPresent; } catch (ExecutionException | InterruptedException e) { throw new RuntimeException(e); } Obtain a present fast from the available offers ☕ Create relationship between threads ☕ Forked tasks are children of the scope ☕ Success/failure policy can be defined across all children.
  • 62. Structured Concurrency Advantages try (var scope = new StructuredTaskScope.ShutdownOnSuccess<Present>()) { var offer1 = scope.fork(() -> readOffer1(refPrice, boxPrice)); var offer2 = scope.fork(() -> readOffer2(refPrice, boxPrice)); var offer3 = scope.fork(() -> readOffer3(refPrice, boxPrice)); var offer4 = scope.fork(() -> readOffer4(refPrice, boxPrice)); scope.join(); Present quickPresent = scope.result(); return quickPresent; } catch (ExecutionException | InterruptedException e) { throw new RuntimeException(e); } Obtain a present fast from the available offers ☕ Create relationship between threads ☕ Forked tasks are children of the scope ☕ Success/failure policy can be defined across all children. ☕ Return the result of the first subtask that completed with a result.
  • 63. Structured Concurrency Advantages try (var scope = new StructuredTaskScope.ShutdownOnSuccess<Present>()) { var offer1 = scope.fork(() -> readOffer1(refPrice, boxPrice)); var offer2 = scope.fork(() -> readOffer2(refPrice, boxPrice)); var offer3 = scope.fork(() -> readOffer3(refPrice, boxPrice)); var offer4 = scope.fork(() -> readOffer4(refPrice, boxPrice)); scope.join(); Present quickPresent = scope.result(); return quickPresent; } catch (ExecutionException | InterruptedException e) { throw new RuntimeException(e); } Obtain a present fast from the available offers ☕ Create relationship between threads ☕ Forked tasks are children of the scope ☕ Success/failure policy can be defined across all children. ☕ Return the result of the first subtask that completed with a result. ☕ Thread-dumps capture transparently the relationship between threads.
  • 64. Benefits for High Scaling Applications Higher throughput with fewer CPU operations when having high number concurrent requests. When having blocking calls, virtual threads will go in a waiting state until they receive data.
  • 65. Experience Scoped Values //in Wrapup record ScopedValue.where(VALID_REQUEST, Choice.EXPERIENCE) .call(() -> findOffer(data.itemPrice())); // in Experience record public Experience { if (!VALID_REQUEST.isBound()) { throw new IllegalStateException("not bound"); } else if (!VALID_REQUEST.get() .equals(Choice.EXPERIENCE)) { throw new IllegalStateException(VALID_REQUEST.get()); } } //… Find the best in price experience ☕ Best experience for a valid request
  • 66. Experience Scoped Values public static class ExperienceScope extends StructuredTaskScope<Experience> { //… try (var scope = new Experience.ExperienceScope()) { scope.fork(() -> readOffer1(referencePrice)); scope.fork(() -> readOffer2(referencePrice)); scope.fork(() -> readOffer3(referencePrice)); scope.fork(() -> readOffer4(referencePrice)); scope.join(); return scope.findOffer(); } catch (InterruptedException e) { throw new RuntimeException(e); } //… Find the best in price experience ☕ Best experience for a valid request ☕ Simplify reasoning about data flow ☕ The lifetime of shared data is visible from code structure. ☕ Data shared by a caller can be retrieved only by legitimate callees. ☕ Performance through immutable shared data.
  • 67. So You Want To Know More ☕ Structured Concurrency ☕ On Parallelism and Concurrency ☕ Java 20 - From ThreadLocal to ScopedValue with Loom Full Tutorial - JEP Café #16 ☕ JEP 453: Structured Concurrency (Preview) ☕ JEP 446: Scoped Values (Preview)
  • 69. Project Leyden ☕ Faster Startup Improving the time to get to the first useful unit of work. ☕ Better Warmup Enhancing the time it takes for the application to reach peak performance. ☕ Provide a unifying conceptual model that lets developers choose how to trade off constraints for performance.
  • 70. Improving Startup and Warmup ☕ Could shift computation work later in time, by utilizing laziness techniques. ☕ Could shift computation work earlier in time, from run time to build time. ☕ Shifting computation can be part of the application (e.g., running application or framework code), or on behalf of the it (e.g., compiling application code). ☕ The JDK already has plenty of features that can shift computation.
  • 71. Java Features that Can Shift Computation ☕ Using the normal semantics of Java programs Compile-time constant folding (shifts earlier) Garbage collection (later) Lazy class loading and initialization (later) ☕ Some require the user to enable them Experimental ahead-of-time (AOT) compilation (earlier) Pre-digested class-data archives (CDS) (earlier)
  • 72. Leyden conceptual model Source https://openjdk.org/projects/leyden/slides/leyden-jvmls-2023-08-08.pdf ☕ Shift computation temporally, both later and earlier in time ☕ Constrain Java’s natural dynamism, if necessary to enable more and better shifting ☕ Selectively, per the needs of each particular program ☕ Compatibly, to preserve program meaning
  • 73. Leyden progress ☕ Introduce condensers Toward Condensers (design note, Brian Goetz, Mark Reinhold, & Paul Sandoz) ☕ Shift computation and constrain dynamism Pre-generate lambda classes (prototype branch, Dan Heidinga) Condensing Indy Bootstraps (design note, Brian Goetz) Computed Constants (draft JEP, Per Ake Minborg & Maurizio Cimadamore) Experiments in shifting speculative compilation (Rose et al.) ☕ Related improvements Hermetic application packaging (prototype branch, Zhou) JMOD-less linking (prototype, Gehwolf) Source JVMLS - Project Leyden
  • 74. Image by Placidplace from Pixabay
  • 75. Project Babylon ☕ Extend Java's reach to foreign programming models. ☕ Code reflection is fit for purpose of GPU programming domains. ☕ Easily implement support for a foreign coding model as a Java library. ☕ API to build, analyze, and transform code models.
  • 76. So you want to know more ☕ https://mail.openjdk.org/pipermail/discuss/2023-September/006226.html ☕ JVMLS - Java and GPU … are we nearly there yet? ☕ JVMLS Code Reflection by Paul Sandoz ☕ Java on GPU
  • 77. Stay Tuned for More! Inside.java Dev.java youtube.com/java