Upload
eelco-meuter
View
153
Download
3
Tags:
Embed Size (px)
Citation preview
@emeuter
Java language principles
• Simplicity matters
• Reading is more important than writing
• One language: with the same meaning everywhere
Keynote JavaOne, 2014
@emeuter
Highlights Java 8
• Lambda’s
• JSR 310: Date and Time API
• Nashorn: Javascript interoperability
• JavaFX: Enhancements
@emeuter
List<Developer> sortAndFilterDevelopersJavaEE(
Collection<Developer> javaCommunity){
List<Developer> result = new ArrayList<>();
for(Developer duke : javaCommunity){
if(duke.skillSet.contains(Skill.JAVA_EE);
result.add(duke)
}
Collections.sort(result, new Comparator<Developer>(){
@Override
public int compare(Developer d1, Developer d2){
return d1.name.compareTo(d2.name);
}
});
return result;
}
@emeuter
List<Developer> sortAndFilterDevelopersJavaEE(
Collection<Developer> javaCommunity){
return javaCommunity.stream()
.filter(duke ->duke.skillSet.contains(Skill.JAVA_EE))
.sorted((Comparator.comparing(duke -> duke.name))
.collect(Collectors.toList());
}
@emeuter
import java.io.IOException;
import java.nio.file.*;
public static void main(String[] args) throws IOException {
String content =
new String(Files.readAllBytes(Paths.get("duke.java")));
}
@emeuter
StringJoiner sj = new StringJoiner(":", "[", "]");
sj.add("George").add("Sally").add("Fred");
System.out.println(sj.toString());
[George:Sally:Fred]
@emeuter
Nashorn: Javascript on the JVM
• Rationale
• Project Avatar
• Scripting languages
• Improved integration
@emeuter
class Point{
int x;
int y;
}
Point[] arrayOfPoints; Header
Point_0
Point_1
…
Header
x
y
Header
x
y
@emeuter
value class Point{
int x;
int y;
}
Point[] arrayOfPoints; Header
Point_0.x
Point_0.y
Point_1.x
Point_1.y
…
@emeuter
Seems to be difficult…
• Big, monolith applications
• Culture that is focussed on IT procedures
• Heterogenic application landscape
• Failing communication
@emeuter
Gain trust with mutant testing
Your code
Mutated code
Your tests …
Mutant killed: Proper test
Mutant lives: Buggy test
fail
succeed Make a small
change test
x = 1 + 2 x = 1 / 2 assertThat(x, is(2))
Mutant killed your code. Oops…
die
@emeuter
• HTTP protocol
– Use the appropriate method: favour POST over PUT
– Use correct HTTP status codes
– Use the header
– URLs are essential
• JSON: Use Javascript conventions