SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Downloaden Sie, um offline zu lesen
This is not your father’s Java
Sven Efftinge - itemis
5 Missing Features
Collection Literals
Object Literals
Closures
Properties
Multiline Strings
Collection Literals

List<String> names =
      new ArrayList<String>();
names.add(“foo”);
names.add(“bar”);
names.add(“baz”);
Collection Literals

List<String> names =
      new ArrayList<>();
names.add(“foo”);
names.add(“bar”);
names.add(“baz”);
Collection Literals


newArrayList(“foo”, “bar”, “baz”)


    Static imports, generiïŹed method
              and var-args!
   Do you already use Google Guava?
Object Literals


Readable data construction
Java Devs usually ïŹ‚ee to some external format,
such as XML or JSON.
Object Literals
         Java enforces imperative style.


Person p = new Person();
p.setFirstName("Hans");
p.setLastName("Albers");
Address address = new Address();
address.setStreet("Am Germaniahafen 1");
address.setCity("Kiel");
p.setAddress(address);
Object Literals
Person p = new Person() {{
  firstName = "Hans";
  lastName = "Albers";
  address   = new Address() {{
    street   = "Am Germaniahafen 1";
    city     = "Kiel";
  }};
}};
Object Literals
Person p = new Person() {{
  firstName = "Hans";
  lastName = "Albers";
  address   = new Address() {{
    street   = "Am Germaniahafen 1";
    city     = "Kiel";
  }};
}};

         anonymous classes
Object Literals
Person p = new Person() {{
  firstName = "Hans";
  lastName = "Albers";
  address   = new Address() {{
    street   = "Am Germaniahafen 1";
    city     = "Kiel";
  }};
}};

              Initializer
No Closures
      My friends’ names in a comma
             separated string.
List<Person> myFriends = ...
StringBuilder sb = new StringBuilder();
for (Person person : myFriends) {
  sb.append(person.getName())
    .append(“, “);
}
String result =
  sb.toString().substring(0, sb.length()-2);
How about this?

List<Person> myFriends = ...

String names = joinFrom(myFriends).getName();




           generics and proxies!

LambdaJ - http://code.google.com/p/lambdaj/
Closures in Java 8


List<Person> myFriends = ...
List<String> names = myFriends
 .map(#{ p -> p.getName(); });
Properties

class Person {
  public String firstName;
}
Person p = ....
p.firstName = “Horst”;
Properties
 class Person {
   public String firstName;
   public void setFirstName(String s) {
     firstName = process(s);
   }
 }
 Person p = ....
 p.firstName = “Horst”;

Byte code manipulation during class loading!
Multiline Strings
public static void main(String[] args)
{
  System.out.println($(/*
    Wow, we finally have
    multiline strings in
    Java! HOOO!
  */));
}

  Source code & stack trace information
Beyond Java

Other JVM-Languages
 Eclipse Xtend
DSLs
 Eclipse Xtext 2.

Weitere Àhnliche Inhalte

Was ist angesagt?

Lecture 22
Lecture 22Lecture 22
Lecture 22rhshriva
 
Grails: The search is over
Grails: The search is overGrails: The search is over
Grails: The search is overAĂ©cio Costa
 
An Introduction to Tuple List Dictionary in Python
An Introduction to Tuple List Dictionary in PythonAn Introduction to Tuple List Dictionary in Python
An Introduction to Tuple List Dictionary in Pythonyashar Aliabasi
 
Invertible-syntax ć…„é–€
Invertible-syntax ć…„é–€Invertible-syntax ć…„é–€
Invertible-syntax ć…„é–€Hiromi Ishii
 
ElasticSearch 5.x - New Tricks - 2017-02-08 - Elasticsearch Meetup
ElasticSearch 5.x -  New Tricks - 2017-02-08 - Elasticsearch Meetup ElasticSearch 5.x -  New Tricks - 2017-02-08 - Elasticsearch Meetup
ElasticSearch 5.x - New Tricks - 2017-02-08 - Elasticsearch Meetup Alberto Paro
 
Grails queries
Grails   queriesGrails   queries
Grails queriesHusain Dalal
 
PHP 7 – What changed internally?
PHP 7 – What changed internally?PHP 7 – What changed internally?
PHP 7 – What changed internally?Nikita Popov
 
2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locator2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locatorAlberto Paro
 
DBIx::Class introduction - 2010
DBIx::Class introduction - 2010DBIx::Class introduction - 2010
DBIx::Class introduction - 2010leo lapworth
 
Creating Domain Specific Languages in Python
Creating Domain Specific Languages in PythonCreating Domain Specific Languages in Python
Creating Domain Specific Languages in PythonSiddhi
 
Class 5 - PHP Strings
Class 5 - PHP StringsClass 5 - PHP Strings
Class 5 - PHP StringsAhmed Swilam
 
The Perl6 Type System
The Perl6 Type SystemThe Perl6 Type System
The Perl6 Type Systemabrummett
 
Protocol-Oriented Programming in Swift
Protocol-Oriented Programming in SwiftProtocol-Oriented Programming in Swift
Protocol-Oriented Programming in SwiftGlobalLogic Ukraine
 
Handout - Introduction to Programming
Handout - Introduction to ProgrammingHandout - Introduction to Programming
Handout - Introduction to ProgrammingCindy Royal
 
DBIx::Class beginners
DBIx::Class beginnersDBIx::Class beginners
DBIx::Class beginnersleo lapworth
 

Was ist angesagt? (19)

Lecture 22
Lecture 22Lecture 22
Lecture 22
 
Grails: The search is over
Grails: The search is overGrails: The search is over
Grails: The search is over
 
An Introduction to Tuple List Dictionary in Python
An Introduction to Tuple List Dictionary in PythonAn Introduction to Tuple List Dictionary in Python
An Introduction to Tuple List Dictionary in Python
 
Invertible-syntax ć…„é–€
Invertible-syntax ć…„é–€Invertible-syntax ć…„é–€
Invertible-syntax ć…„é–€
 
ElasticSearch 5.x - New Tricks - 2017-02-08 - Elasticsearch Meetup
ElasticSearch 5.x -  New Tricks - 2017-02-08 - Elasticsearch Meetup ElasticSearch 5.x -  New Tricks - 2017-02-08 - Elasticsearch Meetup
ElasticSearch 5.x - New Tricks - 2017-02-08 - Elasticsearch Meetup
 
Working with text, Regular expressions
Working with text, Regular expressionsWorking with text, Regular expressions
Working with text, Regular expressions
 
Haskell
HaskellHaskell
Haskell
 
Grails queries
Grails   queriesGrails   queries
Grails queries
 
Functional programming in java
Functional programming in javaFunctional programming in java
Functional programming in java
 
PHP 7 – What changed internally?
PHP 7 – What changed internally?PHP 7 – What changed internally?
PHP 7 – What changed internally?
 
2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locator2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locator
 
DBIx::Class introduction - 2010
DBIx::Class introduction - 2010DBIx::Class introduction - 2010
DBIx::Class introduction - 2010
 
Creating Domain Specific Languages in Python
Creating Domain Specific Languages in PythonCreating Domain Specific Languages in Python
Creating Domain Specific Languages in Python
 
Class 5 - PHP Strings
Class 5 - PHP StringsClass 5 - PHP Strings
Class 5 - PHP Strings
 
Java String class
Java String classJava String class
Java String class
 
The Perl6 Type System
The Perl6 Type SystemThe Perl6 Type System
The Perl6 Type System
 
Protocol-Oriented Programming in Swift
Protocol-Oriented Programming in SwiftProtocol-Oriented Programming in Swift
Protocol-Oriented Programming in Swift
 
Handout - Introduction to Programming
Handout - Introduction to ProgrammingHandout - Introduction to Programming
Handout - Introduction to Programming
 
DBIx::Class beginners
DBIx::Class beginnersDBIx::Class beginners
DBIx::Class beginners
 

Andere mochten auch

Doing REST Right
Doing REST RightDoing REST Right
Doing REST RightKerry Buckley
 
Drive your dba crazy in 3 easy steps
Drive your dba crazy in 3 easy stepsDrive your dba crazy in 3 easy steps
Drive your dba crazy in 3 easy stepsAlberto Brandolini
 
Event driven architecture in practice
Event driven architecture in practiceEvent driven architecture in practice
Event driven architecture in practicemimmozzo_
 
Event Driven Architecture
Event Driven ArchitectureEvent Driven Architecture
Event Driven ArchitectureLourens Naudé
 
Event Driven Architecture
Event Driven ArchitectureEvent Driven Architecture
Event Driven ArchitectureChris Patterson
 
Event-Driven Architecture (EDA)
Event-Driven Architecture (EDA)Event-Driven Architecture (EDA)
Event-Driven Architecture (EDA)WSO2
 

Andere mochten auch (6)

Doing REST Right
Doing REST RightDoing REST Right
Doing REST Right
 
Drive your dba crazy in 3 easy steps
Drive your dba crazy in 3 easy stepsDrive your dba crazy in 3 easy steps
Drive your dba crazy in 3 easy steps
 
Event driven architecture in practice
Event driven architecture in practiceEvent driven architecture in practice
Event driven architecture in practice
 
Event Driven Architecture
Event Driven ArchitectureEvent Driven Architecture
Event Driven Architecture
 
Event Driven Architecture
Event Driven ArchitectureEvent Driven Architecture
Event Driven Architecture
 
Event-Driven Architecture (EDA)
Event-Driven Architecture (EDA)Event-Driven Architecture (EDA)
Event-Driven Architecture (EDA)
 

Ähnlich wie Java is Not Your Father's Java - 5 Missing Features Added in Java 8

Scala in a Java 8 World
Scala in a Java 8 WorldScala in a Java 8 World
Scala in a Java 8 WorldDaniel Blyth
 
What's New In C# 7
What's New In C# 7What's New In C# 7
What's New In C# 7Paulo Morgado
 
Kotlin Programming Language. What it is all about. Roman Belov, PMM in Kotlin
Kotlin Programming Language. What it is all about. Roman Belov, PMM in KotlinKotlin Programming Language. What it is all about. Roman Belov, PMM in Kotlin
Kotlin Programming Language. What it is all about. Roman Belov, PMM in KotlinJetBrains Russia
 
Scala vs Java 8 in a Java 8 World
Scala vs Java 8 in a Java 8 WorldScala vs Java 8 in a Java 8 World
Scala vs Java 8 in a Java 8 WorldBTI360
 
Lambda Expressions in Java 8
Lambda Expressions in Java 8Lambda Expressions in Java 8
Lambda Expressions in Java 8bryanbibat
 
Scala - en bedre og mere effektiv Java?
Scala - en bedre og mere effektiv Java?Scala - en bedre og mere effektiv Java?
Scala - en bedre og mere effektiv Java?Jesper Kamstrup Linnet
 
C# 6.0
C# 6.0C# 6.0
C# 6.0Can BAKIR
 
Softshake 2013: 10 reasons why java developers are jealous of Scala developers
Softshake 2013: 10 reasons why java developers are jealous of Scala developersSoftshake 2013: 10 reasons why java developers are jealous of Scala developers
Softshake 2013: 10 reasons why java developers are jealous of Scala developersMatthew Farwell
 
From android/java to swift (1)
From android/java to swift (1)From android/java to swift (1)
From android/java to swift (1)allanh0526
 
Type script by Howard
Type script by HowardType script by Howard
Type script by HowardLearningTech
 
TypeScript by Howard
TypeScript by HowardTypeScript by Howard
TypeScript by HowardLearningTech
 
Howard type script
Howard   type scriptHoward   type script
Howard type scriptLearningTech
 
2.1 Recap From Day One
2.1 Recap From Day One2.1 Recap From Day One
2.1 Recap From Day Oneretronym
 
Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02Seri Moth
 
Grails - The search is over
Grails - The search is overGrails - The search is over
Grails - The search is overFelipe Coutinho
 
Opa presentation at GamesJs
Opa presentation at GamesJsOpa presentation at GamesJs
Opa presentation at GamesJsHenri Binsztok
 
Linq And Its Impact On The.Net Framework
Linq And Its Impact On The.Net FrameworkLinq And Its Impact On The.Net Framework
Linq And Its Impact On The.Net Frameworkrushputin
 

Ähnlich wie Java is Not Your Father's Java - 5 Missing Features Added in Java 8 (20)

Scala in a Java 8 World
Scala in a Java 8 WorldScala in a Java 8 World
Scala in a Java 8 World
 
Scala - en bedre Java?
Scala - en bedre Java?Scala - en bedre Java?
Scala - en bedre Java?
 
What's New In C# 7
What's New In C# 7What's New In C# 7
What's New In C# 7
 
Kotlin Programming Language. What it is all about. Roman Belov, PMM in Kotlin
Kotlin Programming Language. What it is all about. Roman Belov, PMM in KotlinKotlin Programming Language. What it is all about. Roman Belov, PMM in Kotlin
Kotlin Programming Language. What it is all about. Roman Belov, PMM in Kotlin
 
Scala vs Java 8 in a Java 8 World
Scala vs Java 8 in a Java 8 WorldScala vs Java 8 in a Java 8 World
Scala vs Java 8 in a Java 8 World
 
Lambda Expressions in Java 8
Lambda Expressions in Java 8Lambda Expressions in Java 8
Lambda Expressions in Java 8
 
Scala - en bedre og mere effektiv Java?
Scala - en bedre og mere effektiv Java?Scala - en bedre og mere effektiv Java?
Scala - en bedre og mere effektiv Java?
 
C# 6.0
C# 6.0C# 6.0
C# 6.0
 
Softshake 2013: 10 reasons why java developers are jealous of Scala developers
Softshake 2013: 10 reasons why java developers are jealous of Scala developersSoftshake 2013: 10 reasons why java developers are jealous of Scala developers
Softshake 2013: 10 reasons why java developers are jealous of Scala developers
 
Presentatie - Introductie in Groovy
Presentatie - Introductie in GroovyPresentatie - Introductie in Groovy
Presentatie - Introductie in Groovy
 
From android/java to swift (1)
From android/java to swift (1)From android/java to swift (1)
From android/java to swift (1)
 
Type script by Howard
Type script by HowardType script by Howard
Type script by Howard
 
TypeScript by Howard
TypeScript by HowardTypeScript by Howard
TypeScript by Howard
 
Howard type script
Howard   type scriptHoward   type script
Howard type script
 
2.1 Recap From Day One
2.1 Recap From Day One2.1 Recap From Day One
2.1 Recap From Day One
 
Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02Jsphp 110312161301-phpapp02
Jsphp 110312161301-phpapp02
 
Grails - The search is over
Grails - The search is overGrails - The search is over
Grails - The search is over
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
Opa presentation at GamesJs
Opa presentation at GamesJsOpa presentation at GamesJs
Opa presentation at GamesJs
 
Linq And Its Impact On The.Net Framework
Linq And Its Impact On The.Net FrameworkLinq And Its Impact On The.Net Framework
Linq And Its Impact On The.Net Framework
 

Mehr von Sven Efftinge

Parsing Expression With Xtext
Parsing Expression With XtextParsing Expression With Xtext
Parsing Expression With XtextSven Efftinge
 
Language Engineering With Xtext
Language Engineering With XtextLanguage Engineering With Xtext
Language Engineering With XtextSven Efftinge
 
Future of Xtext
Future of XtextFuture of Xtext
Future of XtextSven Efftinge
 
Auto-GWT : Better GWT Programming with Xtend
Auto-GWT : Better GWT Programming with XtendAuto-GWT : Better GWT Programming with Xtend
Auto-GWT : Better GWT Programming with XtendSven Efftinge
 
Functional programming with Xtend
Functional programming with XtendFunctional programming with Xtend
Functional programming with XtendSven Efftinge
 
Codegeneration With Xtend
Codegeneration With XtendCodegeneration With Xtend
Codegeneration With XtendSven Efftinge
 
Domain Specific Languages (EclipseCon 2012)
Domain Specific Languages (EclipseCon 2012)Domain Specific Languages (EclipseCon 2012)
Domain Specific Languages (EclipseCon 2012)Sven Efftinge
 
Xtend @ EclipseCon 2012
Xtend @ EclipseCon 2012Xtend @ EclipseCon 2012
Xtend @ EclipseCon 2012Sven Efftinge
 
Getting the most out of Java [Nordic Coding-2010]
Getting the most out of Java [Nordic Coding-2010]Getting the most out of Java [Nordic Coding-2010]
Getting the most out of Java [Nordic Coding-2010]Sven Efftinge
 
Xtext at MDD Day 2010
Xtext at MDD Day 2010Xtext at MDD Day 2010
Xtext at MDD Day 2010Sven Efftinge
 
Dependency Injection for Eclipse developers
Dependency Injection for Eclipse developersDependency Injection for Eclipse developers
Dependency Injection for Eclipse developersSven Efftinge
 
Challenges In Dsl Design
Challenges In Dsl DesignChallenges In Dsl Design
Challenges In Dsl DesignSven Efftinge
 
Code Generation in Agile Projects
Code Generation in Agile ProjectsCode Generation in Agile Projects
Code Generation in Agile ProjectsSven Efftinge
 
Xtext Eclipse Con
Xtext Eclipse ConXtext Eclipse Con
Xtext Eclipse ConSven Efftinge
 
Generic Editor
Generic EditorGeneric Editor
Generic EditorSven Efftinge
 
Eclipse Banking Day
Eclipse Banking DayEclipse Banking Day
Eclipse Banking DaySven Efftinge
 
Bessere Softwareentwicklung (Itemis Wintercon)
Bessere Softwareentwicklung (Itemis Wintercon)Bessere Softwareentwicklung (Itemis Wintercon)
Bessere Softwareentwicklung (Itemis Wintercon)Sven Efftinge
 

Mehr von Sven Efftinge (20)

Parsing Expression With Xtext
Parsing Expression With XtextParsing Expression With Xtext
Parsing Expression With Xtext
 
Language Engineering With Xtext
Language Engineering With XtextLanguage Engineering With Xtext
Language Engineering With Xtext
 
Future of Xtext
Future of XtextFuture of Xtext
Future of Xtext
 
Auto-GWT : Better GWT Programming with Xtend
Auto-GWT : Better GWT Programming with XtendAuto-GWT : Better GWT Programming with Xtend
Auto-GWT : Better GWT Programming with Xtend
 
Functional programming with Xtend
Functional programming with XtendFunctional programming with Xtend
Functional programming with Xtend
 
Codegeneration With Xtend
Codegeneration With XtendCodegeneration With Xtend
Codegeneration With Xtend
 
Gwt and Xtend
Gwt and XtendGwt and Xtend
Gwt and Xtend
 
Domain Specific Languages (EclipseCon 2012)
Domain Specific Languages (EclipseCon 2012)Domain Specific Languages (EclipseCon 2012)
Domain Specific Languages (EclipseCon 2012)
 
Xtend @ EclipseCon 2012
Xtend @ EclipseCon 2012Xtend @ EclipseCon 2012
Xtend @ EclipseCon 2012
 
Eclipse Xtend
Eclipse XtendEclipse Xtend
Eclipse Xtend
 
Getting the most out of Java [Nordic Coding-2010]
Getting the most out of Java [Nordic Coding-2010]Getting the most out of Java [Nordic Coding-2010]
Getting the most out of Java [Nordic Coding-2010]
 
Xtext at MDD Day 2010
Xtext at MDD Day 2010Xtext at MDD Day 2010
Xtext at MDD Day 2010
 
Dependency Injection for Eclipse developers
Dependency Injection for Eclipse developersDependency Injection for Eclipse developers
Dependency Injection for Eclipse developers
 
Xtext Webinar
Xtext WebinarXtext Webinar
Xtext Webinar
 
Challenges In Dsl Design
Challenges In Dsl DesignChallenges In Dsl Design
Challenges In Dsl Design
 
Code Generation in Agile Projects
Code Generation in Agile ProjectsCode Generation in Agile Projects
Code Generation in Agile Projects
 
Xtext Eclipse Con
Xtext Eclipse ConXtext Eclipse Con
Xtext Eclipse Con
 
Generic Editor
Generic EditorGeneric Editor
Generic Editor
 
Eclipse Banking Day
Eclipse Banking DayEclipse Banking Day
Eclipse Banking Day
 
Bessere Softwareentwicklung (Itemis Wintercon)
Bessere Softwareentwicklung (Itemis Wintercon)Bessere Softwareentwicklung (Itemis Wintercon)
Bessere Softwareentwicklung (Itemis Wintercon)
 

KĂŒrzlich hochgeladen

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
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...Miguel AraĂșjo
 
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 DevelopmentsTrustArc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 

KĂŒrzlich hochgeladen (20)

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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...
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - 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 🐘
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

Java is Not Your Father's Java - 5 Missing Features Added in Java 8

  • 1. This is not your father’s Java Sven Efftinge - itemis
  • 2. 5 Missing Features Collection Literals Object Literals Closures Properties Multiline Strings
  • 3. Collection Literals List<String> names = new ArrayList<String>(); names.add(“foo”); names.add(“bar”); names.add(“baz”);
  • 4. Collection Literals List<String> names = new ArrayList<>(); names.add(“foo”); names.add(“bar”); names.add(“baz”);
  • 5. Collection Literals newArrayList(“foo”, “bar”, “baz”) Static imports, generiïŹed method and var-args! Do you already use Google Guava?
  • 6. Object Literals Readable data construction Java Devs usually ïŹ‚ee to some external format, such as XML or JSON.
  • 7. Object Literals Java enforces imperative style. Person p = new Person(); p.setFirstName("Hans"); p.setLastName("Albers"); Address address = new Address(); address.setStreet("Am Germaniahafen 1"); address.setCity("Kiel"); p.setAddress(address);
  • 8. Object Literals Person p = new Person() {{ firstName = "Hans"; lastName = "Albers"; address = new Address() {{ street = "Am Germaniahafen 1"; city = "Kiel"; }}; }};
  • 9. Object Literals Person p = new Person() {{ firstName = "Hans"; lastName = "Albers"; address = new Address() {{ street = "Am Germaniahafen 1"; city = "Kiel"; }}; }}; anonymous classes
  • 10. Object Literals Person p = new Person() {{ firstName = "Hans"; lastName = "Albers"; address = new Address() {{ street = "Am Germaniahafen 1"; city = "Kiel"; }}; }}; Initializer
  • 11. No Closures My friends’ names in a comma separated string. List<Person> myFriends = ... StringBuilder sb = new StringBuilder(); for (Person person : myFriends) { sb.append(person.getName()) .append(“, “); } String result = sb.toString().substring(0, sb.length()-2);
  • 12. How about this? List<Person> myFriends = ... String names = joinFrom(myFriends).getName(); generics and proxies! LambdaJ - http://code.google.com/p/lambdaj/
  • 13. Closures in Java 8 List<Person> myFriends = ... List<String> names = myFriends .map(#{ p -> p.getName(); });
  • 14. Properties class Person { public String firstName; } Person p = .... p.firstName = “Horst”;
  • 15. Properties class Person { public String firstName; public void setFirstName(String s) { firstName = process(s); } } Person p = .... p.firstName = “Horst”; Byte code manipulation during class loading!
  • 16. Multiline Strings public static void main(String[] args) { System.out.println($(/* Wow, we finally have multiline strings in Java! HOOO! */)); } Source code & stack trace information
  • 17. Beyond Java Other JVM-Languages Eclipse Xtend DSLs Eclipse Xtext 2.