turn ideas into code faster
Moritz Eysholdt
itemis AG
turn ideas into code faster
!
Java

Moritz Eysholdt
itemis AG
!

Java
!

Java
immutability
dispatch
data_extraction
polymorphism

caching

data_transformation

!

Java
design_patterns
state

null_stat...
immutability

for

dispatch
data_extraction

caching

if

implements
extends

polymorphism

data_transformation

!

Java
d...
immutability
dispatch

caching

data_transformation

if

for

implements

data_extraction
polymorphism

!
state
null_state...
!

Xtend

Java
functional_programming
dispatch
templates

!

Xtend
lambdas
extension_methods
active_annotations

Java
functional_programming
dispatch
templates

!

Xtend
lambdas
extension_methods
active_annotations

Java
Java

for-if-spaghetti
List<String> result = new ArrayList<String>();
for(Integer integer: integers) {
if(integer > 10) {
...
Java

if-else-spaghetti

String result = null;
if(foo != null) {
result = foo.value;
}
String result;
if(bar != null) {
re...
Java

call non-member methods

backwards(reading(are(you(“X”))))

“X”.you.are.reading.backwards

Xtend

extension methods
Java

type-def boilerplate

Map<String, Set<Integer>> ints = new HashMap<String, Set<Integer>>();

val ints = new HashMap<...
Java

if-else-instanceof-spaghetti

if(shape instanceof Rect)
return ((Rect) shape).width * ((Rect) shape).height;
else if...
Java

if-else-instanceof-spaghetti
Xtend

public double surface(Shape shape) {
if(shape instanceof Rect)
return surface((R...
Java

immutable class boilerplate

@Data class Point {
int x
int y
}

public class Point {
private final int x;
private fi...
Java

getter/setter boilerplate

public class Point {
private int x;
private int y;
public
public
public
public

int getX(...
Java

boilerplate or design pattern

public class MyClass {
...
...
...
...

...
...
...
...

...
...
...
...

{
{
{
{

.....
EOF
Upcoming SlideShare
Loading in...5
×

Turning Ideas Into Code Faster

548

Published on

I presented these slides as a lightning talk at the EclipseCon Europe 2013
http://www.eclipsecon.org/europe2013/lightning-talks

Published in: Technology, News & Politics
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
548
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
14
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Turning Ideas Into Code Faster

  1. 1. turn ideas into code faster Moritz Eysholdt itemis AG
  2. 2. turn ideas into code faster ! Java Moritz Eysholdt itemis AG
  3. 3. ! Java
  4. 4. ! Java
  5. 5. immutability dispatch data_extraction polymorphism caching data_transformation ! Java design_patterns state null_state events persistence localization
  6. 6. immutability for dispatch data_extraction caching if implements extends polymorphism data_transformation ! Java design_patterns while state null_state events break ; persistence localization return fields variables
  7. 7. immutability dispatch caching data_transformation if for implements data_extraction polymorphism ! state null_state events localization persistence design_patterns extends Java while break variables fields ; return
  8. 8. ! Xtend Java
  9. 9. functional_programming dispatch templates ! Xtend lambdas extension_methods active_annotations Java
  10. 10. functional_programming dispatch templates ! Xtend lambdas extension_methods active_annotations Java
  11. 11. Java for-if-spaghetti List<String> result = new ArrayList<String>(); for(Integer integer: integers) { if(integer > 10) { result.add(“Int: ” + integer); } } val result = integers.filter[it > 10].map[“Int” + it] Xtend functional programming
  12. 12. Java if-else-spaghetti String result = null; if(foo != null) { result = foo.value; } String result; if(bar != null) { result = bar; } else { result = “unset”; } val result = foo?.value val result = bar ?: “unset” Xtend null-safe operators
  13. 13. Java call non-member methods backwards(reading(are(you(“X”)))) “X”.you.are.reading.backwards Xtend extension methods
  14. 14. Java type-def boilerplate Map<String, Set<Integer>> ints = new HashMap<String, Set<Integer>>(); val ints = new HashMap<String, Set<Integer>> Xtend type inference
  15. 15. Java if-else-instanceof-spaghetti if(shape instanceof Rect) return ((Rect) shape).width * ((Rect) shape).height; else if(shape instanceof Circle) return ((Circle) shape).radius * 2 * PI; else return 0; return switch shape { Rect: shape.width * shape.height Circle: shape.radius * 2 * PI default: 0 } Xtend smart switch expression
  16. 16. Java if-else-instanceof-spaghetti Xtend public double surface(Shape shape) { if(shape instanceof Rect) return surface((Rect) shape); else if(shape instanceof Circle) return surface((Circle) shape); return 0; } protected double surface(Rectangle rect) { return rect.width * rect.height; } protected double surface(Circle circle) { return circle.radius * 2 + PI; } dispatch methods def dispatch surface(Rectangle rect) { rect.width * rect.height; } def dispatch surface(Circle circle) { circle.radius * 2 + PI; }
  17. 17. Java immutable class boilerplate @Data class Point { int x int y } public class Point { private final int x; private final int y; public public public public public public Foo(int x, int x) { ... } int getX() { ... } int getY() { ... } int hashCode() { ... } boolean equals(Object obj) { ... } String toString() { ... } } Xtend @Data annotation
  18. 18. Java getter/setter boilerplate public class Point { private int x; private int y; public public public public int getX() { ... int getY() { ... void setX(int x) void setY(int y) } } { ... } { ... } class Point { @Property int x @Property int y } } Xtend @Property annotation
  19. 19. Java boilerplate or design pattern public class MyClass { ... ... ... ... ... ... ... ... ... ... ... ... { { { { ... ... ... ... } } } } @MyAnnotation class MyClass { ... } } Xtend active annotation
  20. 20. EOF
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×