SlideShare a Scribd company logo
Java 8 eXperiment(s)
François Sarradin

Normandy JUG

20 octobre 2015
WARNING!!!
françois sarradin
• ippon technologies (ippon.fr)
• manager technique capitalisation
• extremist programmer, FP, agilité
• http://brownbaglunch.fr/
• twitter: @fsarradin
• blog: https://kerflyn.wordpress.com/
plan
1. héritage multiple
2. exception
3. pattern matching
et du live coding !!!
héritage multiple
objet = état + comportement
en java 8, on peut faire de l’héritage
multiple de comportement
mais peut-on faire de l’héritage
multiple d’état ?
un mail de Brian Goetz
Subject: Re: From virtual extension
methods to mixing
From: Brian Goetz <…@oracle.com>
Date: Mon, 9 Jul 2012 07:50:11 -0400
Cc: lambda-dev@openjdk.java.net
To: François Sarradin <…@gmail.com>
Please don't encourage techniques like
this. There are a zillion "clever" things you
can do in Java, but shouldn't. We knew it
wouldn’t be long before someone
suggested this, and we can't stop you. But
please, use your power for good, and not
for evil. Teach people to do it right, not to
abuse it.
But please, use your power for
good, and not for evil.
Please don't encourage
techniques like this.
un autre mail de Brian Goetz
Subject: Re: From virtual extension
methods to mixins
From: Brian Goetz <…@oracle.com>
Date: Tue, 10 Jul 2012 19:51:55 -0400
To: François Sarradin <…@gmail.com>
[…]
The bottom line is:
interfaces cannot be counted on to have
identity.
Which is a good thing, but can bite the
"clever" from behind :)
ce qu’il faut retenir
un mail de Brian Goetz
Subject: Re: From virtual extension
methods to mixing
From: Brian Goetz <…@oracle.com>
Date: Mon, 9 Jul 2012 07:50:11 -0400
Cc: lambda-dev@openjdk.java.net
To: François Sarradin <…@gmail.com>
Please don't encourage techniques like
this. There are a zillion "clever" things
you can do in Java, but shouldn't. We
knew it wouldn’t be long before someone
suggested this, and we can't stop you. But
please, use your power for good, and not
for evil. Teach people to do it right, not to
abuse it.
There are a zillion
"clever" things you
can do in Java, but
shouldn't.
exception
sun.misc.Unsafe est voué à
disparaître ?
checked exception non déclarée
Field f = Unsafe.class.getDeclaredField("theUnsafe");
f.setAccessible(true);
Unsafe unsafe = (Unsafe) f.get(null);
// throw undeclared checked exception
unsafe.throwException(new IOException());
alternative ?
ce qu’il faut retenir
limiter le nombre de sous-classes
public class Base {
private Base() {}
public static class Class1 extends Base {}
public static class Class2 extends Base {}
// ...
}
type checking
• limitation des sous-classes + generics => TDD
• TDD = type driven development
• ATTENTION !!! null interdit (checkstyle)
pyramide de test
UI
Intégration
Unitaire
Compilateur
pattern matching
Java 8 introduit la
programmation fonctionnelle
peut-on tenter d’y introduire le
pattern matching
pattern matching (scala)
myValue match {
case "hello" => println("hello world")
case i: Int => println("int: $i")
case Add(a, b) => println("$a + $b = ${a + b}")
case _ => println("what else!")
}
ce qu’il faut retenir
dsl en java
FirstWord firstWord(T t) { return new FirstWord(t); }
class FirstWord {
final T t;
FirstWord(T t) { this.t = t; }
FirstWord repeat(T t0) { return new FirstWord(t + t0); }
SecondWord secondWord(R r) { return new SecondWord(r); }
class SecondWord(R r) {
final R r;
SecondWord(R r) { this.r = r; }
S end() { return /* ... */; }
}
}
functional apis (beyond java 8)
• fugue (https://bitbucket.org/atlassian/fugue)
• functional java (http://www.functionaljava.org/)
• totallylazy (http://totallylazy.com/)
• jOOλ (https://github.com/jOOQ/jOOL)
• javaslang (http://javaslang.com/)
• cyclops (https://github.com/aol/cyclops)
conclusion
• optimisation en java (ne pas trop avec les concepts)
• limiter le nombres de sous-classes
• type driven development
• dsl en java
KEEP
CALM
AND
THANK
YOU

More Related Content

What's hot

Exceptions in java
Exceptions in javaExceptions in java
Exceptions in java
Sameer Patil
 
Exceptions in java
Exceptions in javaExceptions in java
Exceptions in java
Manav Prasad
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in java
pooja kumari
 
Exceptional Handling in Java
Exceptional Handling in JavaExceptional Handling in Java
Exceptional Handling in Java
QaziUmarF786
 
Java Pitfalls and Good-to-Knows
Java Pitfalls and Good-to-KnowsJava Pitfalls and Good-to-Knows
Java Pitfalls and Good-to-Knows
Miquel Martin
 

What's hot (7)

Exception handling
Exception handlingException handling
Exception handling
 
Exceptions in java
Exceptions in javaExceptions in java
Exceptions in java
 
Exceptions in java
Exceptions in javaExceptions in java
Exceptions in java
 
Exception handling in Java
Exception handling in JavaException handling in Java
Exception handling in Java
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in java
 
Exceptional Handling in Java
Exceptional Handling in JavaExceptional Handling in Java
Exceptional Handling in Java
 
Java Pitfalls and Good-to-Knows
Java Pitfalls and Good-to-KnowsJava Pitfalls and Good-to-Knows
Java Pitfalls and Good-to-Knows
 

Viewers also liked

Un mes, una estampa. Ver Sevilla.
Un mes, una estampa. Ver Sevilla.Un mes, una estampa. Ver Sevilla.
Un mes, una estampa. Ver Sevilla.
Abengoa
 
Ppsileshare
PpsilesharePpsileshare
Ppsileshare
Gabyta1611
 
Cuidatge guía de uso vr. 2
Cuidatge guía de uso vr. 2Cuidatge guía de uso vr. 2
Cuidatge guía de uso vr. 2
Marta Domínguez-Senra
 
Guia de-precios-compugreiff-5-de-septiembre-de-2015
Guia de-precios-compugreiff-5-de-septiembre-de-2015Guia de-precios-compugreiff-5-de-septiembre-de-2015
Guia de-precios-compugreiff-5-de-septiembre-de-2015
xxxxx
 
CornerStone Volume 16 Issue 2
CornerStone Volume 16 Issue 2CornerStone Volume 16 Issue 2
CornerStone Volume 16 Issue 2Ryan Vinson
 
Evangelizing SEO
Evangelizing SEOEvangelizing SEO
Evangelizing SEO
Kenyon Manu
 
Final mhs
Final mhsFinal mhs
Final mhsteniyuo
 
Business System Development
Business System DevelopmentBusiness System Development
Business System Developmentsteffiann88
 
Power Point For Cmgt 410
Power Point For Cmgt 410Power Point For Cmgt 410
Power Point For Cmgt 410steffiann88
 
072 técnicas agrícolas e industriais
072   técnicas agrícolas e industriais072   técnicas agrícolas e industriais
072 técnicas agrícolas e industriaispibiduergsmontenegro
 
PEDro: guía de uso vr2
PEDro:  guía de uso vr2PEDro:  guía de uso vr2
PEDro: guía de uso vr2
Marta Domínguez-Senra
 
Кейс NOKIAN Tyres. Электронная эволюция финансово-учетного документооборота
Кейс NOKIAN Tyres. Электронная эволюция финансово-учетного документооборотаКейс NOKIAN Tyres. Электронная эволюция финансово-учетного документооборота
Кейс NOKIAN Tyres. Электронная эволюция финансово-учетного документооборота
DIRECTUM
 
Arany János
Arany JánosArany János
Arany János
melindamagdolna
 
Поговорим о микрооптимизациях .NET-приложений
Поговорим о микрооптимизациях .NET-приложенийПоговорим о микрооптимизациях .NET-приложений
Поговорим о микрооптимизациях .NET-приложений
Andrey Akinshin
 
Tanot mata temple, tanot mata mandir tourism infopedia
Tanot mata temple, tanot mata mandir   tourism infopediaTanot mata temple, tanot mata mandir   tourism infopedia
Tanot mata temple, tanot mata mandir tourism infopedia
tourisminfopedia
 

Viewers also liked (16)

Un mes, una estampa. Ver Sevilla.
Un mes, una estampa. Ver Sevilla.Un mes, una estampa. Ver Sevilla.
Un mes, una estampa. Ver Sevilla.
 
Ppsileshare
PpsilesharePpsileshare
Ppsileshare
 
Cuidatge guía de uso vr. 2
Cuidatge guía de uso vr. 2Cuidatge guía de uso vr. 2
Cuidatge guía de uso vr. 2
 
Guia de-precios-compugreiff-5-de-septiembre-de-2015
Guia de-precios-compugreiff-5-de-septiembre-de-2015Guia de-precios-compugreiff-5-de-septiembre-de-2015
Guia de-precios-compugreiff-5-de-septiembre-de-2015
 
CornerStone Volume 16 Issue 2
CornerStone Volume 16 Issue 2CornerStone Volume 16 Issue 2
CornerStone Volume 16 Issue 2
 
21 varonil
21 varonil21 varonil
21 varonil
 
Evangelizing SEO
Evangelizing SEOEvangelizing SEO
Evangelizing SEO
 
Final mhs
Final mhsFinal mhs
Final mhs
 
Business System Development
Business System DevelopmentBusiness System Development
Business System Development
 
Power Point For Cmgt 410
Power Point For Cmgt 410Power Point For Cmgt 410
Power Point For Cmgt 410
 
072 técnicas agrícolas e industriais
072   técnicas agrícolas e industriais072   técnicas agrícolas e industriais
072 técnicas agrícolas e industriais
 
PEDro: guía de uso vr2
PEDro:  guía de uso vr2PEDro:  guía de uso vr2
PEDro: guía de uso vr2
 
Кейс NOKIAN Tyres. Электронная эволюция финансово-учетного документооборота
Кейс NOKIAN Tyres. Электронная эволюция финансово-учетного документооборотаКейс NOKIAN Tyres. Электронная эволюция финансово-учетного документооборота
Кейс NOKIAN Tyres. Электронная эволюция финансово-учетного документооборота
 
Arany János
Arany JánosArany János
Arany János
 
Поговорим о микрооптимизациях .NET-приложений
Поговорим о микрооптимизациях .NET-приложенийПоговорим о микрооптимизациях .NET-приложений
Поговорим о микрооптимизациях .NET-приложений
 
Tanot mata temple, tanot mata mandir tourism infopedia
Tanot mata temple, tanot mata mandir   tourism infopediaTanot mata temple, tanot mata mandir   tourism infopedia
Tanot mata temple, tanot mata mandir tourism infopedia
 

Similar to Java8 eXperiment - Normandy JUG

DevDay.lk - Bare Knuckle Web Development
DevDay.lk - Bare Knuckle Web DevelopmentDevDay.lk - Bare Knuckle Web Development
DevDay.lk - Bare Knuckle Web Development
Johannes Brodwall
 
Working with c++ legacy code
Working with c++ legacy codeWorking with c++ legacy code
Working with c++ legacy code
Dror Helper
 
C++ The Principles of Most Surprise
C++ The Principles of Most SurpriseC++ The Principles of Most Surprise
C++ The Principles of Most Surprise
Patricia Aas
 
2010 A Net Odyssey
2010 A Net Odyssey2010 A Net Odyssey
2010 A Net Odyssey
Saumil Shah
 
Java notes | All Basics |
Java notes | All Basics |Java notes | All Basics |
Java notes | All Basics |
ShubhamAthawane
 
Desenvolvimento moderno de aplicativos android
Desenvolvimento moderno de aplicativos androidDesenvolvimento moderno de aplicativos android
Desenvolvimento moderno de aplicativos android
Diego Figueredo
 
[Wroclaw #7] Why So Serial?
[Wroclaw #7] Why So Serial?[Wroclaw #7] Why So Serial?
[Wroclaw #7] Why So Serial?
OWASP
 
DWX 2013 Nuremberg
DWX 2013 NurembergDWX 2013 Nuremberg
DWX 2013 Nuremberg
Marcel Bruch
 
How to find Zero day vulnerabilities
How to find Zero day vulnerabilitiesHow to find Zero day vulnerabilities
How to find Zero day vulnerabilities
Mohammed A. Imran
 
DevSecOps and Drupal: Securing your applications in a modern IT landscape
DevSecOps and Drupal: Securing your applications in a modern IT landscapeDevSecOps and Drupal: Securing your applications in a modern IT landscape
DevSecOps and Drupal: Securing your applications in a modern IT landscape
Will Hall
 
GOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter SlidesGOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter Slides
Alexandra Masterson
 
You shouldneverdo
You shouldneverdoYou shouldneverdo
You shouldneverdodaniil3
 
Mind Control to Major Tom: Is It Time to Put Your EEG Headset On?
Mind Control to Major Tom: Is It Time to Put Your EEG Headset On? Mind Control to Major Tom: Is It Time to Put Your EEG Headset On?
Mind Control to Major Tom: Is It Time to Put Your EEG Headset On?
Steve Poole
 
Java onguice20070426
Java onguice20070426Java onguice20070426
Java onguice20070426Ratul Ray
 
Making an Exception
Making an ExceptionMaking an Exception
Making an Exception
Kevlin Henney
 
Leveling Up at JavaScript
Leveling Up at JavaScriptLeveling Up at JavaScript
Leveling Up at JavaScript
Raymond Camden
 
OpenDaylight Developer Experience 2.0
 OpenDaylight Developer Experience 2.0 OpenDaylight Developer Experience 2.0
OpenDaylight Developer Experience 2.0
Michael Vorburger
 
Dependency Injection and Autofac
Dependency Injection and AutofacDependency Injection and Autofac
Dependency Injection and Autofac
meghantaylor
 
jsDay - Javascript as a programming language
jsDay - Javascript as a programming languagejsDay - Javascript as a programming language
jsDay - Javascript as a programming language
Marco Cedaro
 

Similar to Java8 eXperiment - Normandy JUG (20)

DevDay.lk - Bare Knuckle Web Development
DevDay.lk - Bare Knuckle Web DevelopmentDevDay.lk - Bare Knuckle Web Development
DevDay.lk - Bare Knuckle Web Development
 
Working with c++ legacy code
Working with c++ legacy codeWorking with c++ legacy code
Working with c++ legacy code
 
C++ The Principles of Most Surprise
C++ The Principles of Most SurpriseC++ The Principles of Most Surprise
C++ The Principles of Most Surprise
 
2010 A Net Odyssey
2010 A Net Odyssey2010 A Net Odyssey
2010 A Net Odyssey
 
Java notes | All Basics |
Java notes | All Basics |Java notes | All Basics |
Java notes | All Basics |
 
Desenvolvimento moderno de aplicativos android
Desenvolvimento moderno de aplicativos androidDesenvolvimento moderno de aplicativos android
Desenvolvimento moderno de aplicativos android
 
All of Javascript
All of JavascriptAll of Javascript
All of Javascript
 
[Wroclaw #7] Why So Serial?
[Wroclaw #7] Why So Serial?[Wroclaw #7] Why So Serial?
[Wroclaw #7] Why So Serial?
 
DWX 2013 Nuremberg
DWX 2013 NurembergDWX 2013 Nuremberg
DWX 2013 Nuremberg
 
How to find Zero day vulnerabilities
How to find Zero day vulnerabilitiesHow to find Zero day vulnerabilities
How to find Zero day vulnerabilities
 
DevSecOps and Drupal: Securing your applications in a modern IT landscape
DevSecOps and Drupal: Securing your applications in a modern IT landscapeDevSecOps and Drupal: Securing your applications in a modern IT landscape
DevSecOps and Drupal: Securing your applications in a modern IT landscape
 
GOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter SlidesGOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter Slides
 
You shouldneverdo
You shouldneverdoYou shouldneverdo
You shouldneverdo
 
Mind Control to Major Tom: Is It Time to Put Your EEG Headset On?
Mind Control to Major Tom: Is It Time to Put Your EEG Headset On? Mind Control to Major Tom: Is It Time to Put Your EEG Headset On?
Mind Control to Major Tom: Is It Time to Put Your EEG Headset On?
 
Java onguice20070426
Java onguice20070426Java onguice20070426
Java onguice20070426
 
Making an Exception
Making an ExceptionMaking an Exception
Making an Exception
 
Leveling Up at JavaScript
Leveling Up at JavaScriptLeveling Up at JavaScript
Leveling Up at JavaScript
 
OpenDaylight Developer Experience 2.0
 OpenDaylight Developer Experience 2.0 OpenDaylight Developer Experience 2.0
OpenDaylight Developer Experience 2.0
 
Dependency Injection and Autofac
Dependency Injection and AutofacDependency Injection and Autofac
Dependency Injection and Autofac
 
jsDay - Javascript as a programming language
jsDay - Javascript as a programming languagejsDay - Javascript as a programming language
jsDay - Javascript as a programming language
 

More from François Sarradin

Java (8) eXperiments - DevoxxFR 2016
Java (8) eXperiments - DevoxxFR 2016Java (8) eXperiments - DevoxxFR 2016
Java (8) eXperiments - DevoxxFR 2016
François Sarradin
 
FLATMAP ZAT SHIT : les monades expliquées aux geeks (Devoxx France 2013)
FLATMAP ZAT SHIT : les monades expliquées aux geeks (Devoxx France 2013)FLATMAP ZAT SHIT : les monades expliquées aux geeks (Devoxx France 2013)
FLATMAP ZAT SHIT : les monades expliquées aux geeks (Devoxx France 2013)
François Sarradin
 
Scala vs java 8
Scala vs java 8Scala vs java 8
Scala vs java 8
François Sarradin
 

More from François Sarradin (6)

Java (8) eXperiments - DevoxxFR 2016
Java (8) eXperiments - DevoxxFR 2016Java (8) eXperiments - DevoxxFR 2016
Java (8) eXperiments - DevoxxFR 2016
 
FLATMAP ZAT SHIT : les monades expliquées aux geeks (Devoxx France 2013)
FLATMAP ZAT SHIT : les monades expliquées aux geeks (Devoxx France 2013)FLATMAP ZAT SHIT : les monades expliquées aux geeks (Devoxx France 2013)
FLATMAP ZAT SHIT : les monades expliquées aux geeks (Devoxx France 2013)
 
Scala vs java 8
Scala vs java 8Scala vs java 8
Scala vs java 8
 
Java 8 Lambda
Java 8 LambdaJava 8 Lambda
Java 8 Lambda
 
JavaScript Core
JavaScript CoreJavaScript Core
JavaScript Core
 
Programmation Fonctionnelle
Programmation FonctionnelleProgrammation Fonctionnelle
Programmation Fonctionnelle
 

Recently uploaded

Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Yara Milbes
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 

Recently uploaded (20)

Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 

Java8 eXperiment - Normandy JUG

  • 1. Java 8 eXperiment(s) François Sarradin Normandy JUG 20 octobre 2015
  • 3. françois sarradin • ippon technologies (ippon.fr) • manager technique capitalisation • extremist programmer, FP, agilité • http://brownbaglunch.fr/ • twitter: @fsarradin • blog: https://kerflyn.wordpress.com/
  • 4. plan 1. héritage multiple 2. exception 3. pattern matching et du live coding !!!
  • 6. objet = état + comportement
  • 7. en java 8, on peut faire de l’héritage multiple de comportement
  • 8.
  • 9. mais peut-on faire de l’héritage multiple d’état ?
  • 10. un mail de Brian Goetz Subject: Re: From virtual extension methods to mixing From: Brian Goetz <…@oracle.com> Date: Mon, 9 Jul 2012 07:50:11 -0400 Cc: lambda-dev@openjdk.java.net To: François Sarradin <…@gmail.com> Please don't encourage techniques like this. There are a zillion "clever" things you can do in Java, but shouldn't. We knew it wouldn’t be long before someone suggested this, and we can't stop you. But please, use your power for good, and not for evil. Teach people to do it right, not to abuse it. But please, use your power for good, and not for evil. Please don't encourage techniques like this.
  • 11.
  • 12. un autre mail de Brian Goetz Subject: Re: From virtual extension methods to mixins From: Brian Goetz <…@oracle.com> Date: Tue, 10 Jul 2012 19:51:55 -0400 To: François Sarradin <…@gmail.com> […] The bottom line is: interfaces cannot be counted on to have identity. Which is a good thing, but can bite the "clever" from behind :)
  • 13. ce qu’il faut retenir
  • 14.
  • 15. un mail de Brian Goetz Subject: Re: From virtual extension methods to mixing From: Brian Goetz <…@oracle.com> Date: Mon, 9 Jul 2012 07:50:11 -0400 Cc: lambda-dev@openjdk.java.net To: François Sarradin <…@gmail.com> Please don't encourage techniques like this. There are a zillion "clever" things you can do in Java, but shouldn't. We knew it wouldn’t be long before someone suggested this, and we can't stop you. But please, use your power for good, and not for evil. Teach people to do it right, not to abuse it. There are a zillion "clever" things you can do in Java, but shouldn't.
  • 17. sun.misc.Unsafe est voué à disparaître ?
  • 18.
  • 19. checked exception non déclarée Field f = Unsafe.class.getDeclaredField("theUnsafe"); f.setAccessible(true); Unsafe unsafe = (Unsafe) f.get(null); // throw undeclared checked exception unsafe.throwException(new IOException());
  • 21. ce qu’il faut retenir
  • 22. limiter le nombre de sous-classes public class Base { private Base() {} public static class Class1 extends Base {} public static class Class2 extends Base {} // ... }
  • 23. type checking • limitation des sous-classes + generics => TDD • TDD = type driven development • ATTENTION !!! null interdit (checkstyle)
  • 26. Java 8 introduit la programmation fonctionnelle
  • 27. peut-on tenter d’y introduire le pattern matching
  • 28. pattern matching (scala) myValue match { case "hello" => println("hello world") case i: Int => println("int: $i") case Add(a, b) => println("$a + $b = ${a + b}") case _ => println("what else!") }
  • 29. ce qu’il faut retenir
  • 30. dsl en java FirstWord firstWord(T t) { return new FirstWord(t); } class FirstWord { final T t; FirstWord(T t) { this.t = t; } FirstWord repeat(T t0) { return new FirstWord(t + t0); } SecondWord secondWord(R r) { return new SecondWord(r); } class SecondWord(R r) { final R r; SecondWord(R r) { this.r = r; } S end() { return /* ... */; } } }
  • 31. functional apis (beyond java 8) • fugue (https://bitbucket.org/atlassian/fugue) • functional java (http://www.functionaljava.org/) • totallylazy (http://totallylazy.com/) • jOOλ (https://github.com/jOOQ/jOOL) • javaslang (http://javaslang.com/) • cyclops (https://github.com/aol/cyclops)
  • 33. • optimisation en java (ne pas trop avec les concepts) • limiter le nombres de sous-classes • type driven development • dsl en java