Live	
  Coding:	
  
	
  

	
  
By	
  Urs	
  Peter	
  
upeter@xebia.com	
  
@urs_peter	
  

	
  

	
  
New	
  Features	
  of	
  Java	
  8	
  
•  JSR	
  335	
  Lambda	
  Expressions	
  and	
  Virtual	
  Extension	
  
Methods	
...
New	
  Features	
  of	
  Java	
  8	
  
•  JSR	
  335	
  Lambda	
  Expressions	
  and	
  Virtual	
  Extension	
  
Methods	
...
New	
  Features	
  of	
  Java	
  8	
  
•  JSR	
  335	
  Lambda	
  Expressions	
  and	
  Virtual	
  Extension	
  
Methods	
...
Let’s	
  Dive	
  into	
  Java	
  8!	
  
What	
  will	
  change	
  for	
  you?	
  
FuncJonal	
  programming	
  	
  
becomes	
  mainstream!	
  
How	
  to	
  get	
  funcJonal	
  
•  Change	
  the	
  way	
  you	
  look	
  at	
  programming	
  logic:	
  
–  Think	
  in...
How	
  to	
  get	
  funcJonal	
  
•  Start	
  using	
  higher	
  order	
  funcJons	
  (filter(),
in	
  CollecJons/Streams	...
When	
  to	
  apply	
  	
  
Virtual	
  Extension	
  Methods	
  
	
  
•  Use	
  Virtual	
  Extension	
  Methods	
  to	
  ma...
Q	
  &	
  A	
  

	
  
Urs	
  Peter	
  
upeter@xebia.com	
  
@urs_peter	
  

	
  

	
  
Upcoming SlideShare
Loading in …5
×

Live coding java 8 urs peter

1,550 views
1,527 views

Published on

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

  • Be the first to like this

No Downloads
Views
Total views
1,550
On SlideShare
0
From Embeds
0
Number of Embeds
964
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Live coding java 8 urs peter

  1. 1. Live  Coding:       By  Urs  Peter   upeter@xebia.com   @urs_peter      
  2. 2. New  Features  of  Java  8   •  JSR  335  Lambda  Expressions  and  Virtual  Extension   Methods   •  JSR  308  AnnotaJons  on  Java  Types   Map<@NonNull String, @NonEmpty List<@Readonly Document>> files;! •  JSR  310  Date  and  Time  API   OffsetDateTime now = OffsetDateTime.now(); System.out.println(now.format(DateTimeFormatter.ISO_DATE));!
  3. 3. New  Features  of  Java  8   •  JSR  335  Lambda  Expressions  and  Virtual  Extension   Methods   •  JSR  308  AnnotaJons  on  Java  Types   Map<@NonNull String, @NonEmpty List<@Readonly Document>> files;! •  JSR  310  Date  and  Time  API   OffsetDateTime now = OffsetDateTime.now(); System.out.println(now.format(DateTimeFormatter.ISO_DATE));!
  4. 4. New  Features  of  Java  8   •  JSR  335  Lambda  Expressions  and  Virtual  Extension   Methods   FuncAonal   MulAple   •  JSR  308  AnnotaJons  on  Java  Types   Programming   Inheritance  of   Map<@NonNull String, @NonEmpty List<@Readonly Document>> files;! Behaviour   •  JSR  310  Date  and  Time  API   OffsetDateTime now = OffsetDateTime.now(); System.out.println(now.format(DateTimeFormatter.ISO_DATE));!
  5. 5. Let’s  Dive  into  Java  8!  
  6. 6. What  will  change  for  you?   FuncJonal  programming     becomes  mainstream!  
  7. 7. How  to  get  funcJonal   •  Change  the  way  you  look  at  programming  logic:   –  Think  in  terms  of  transforming  data  or  input/output     …instead  manipulaJng  state   –  Make  immutable  programming  the  default,  mutable   programming  the  excepJon   –  FuncJonal  programming  implies  programming  on  a  higher   abstracAon  level    
  8. 8. How  to  get  funcJonal   •  Start  using  higher  order  funcJons  (filter(), in  CollecJons/Streams   map() –  Whenever  you  use  a  for loop  try  to  come  up  with  a   funcJonal  alternaJve   •  Use  Lambda’s  in  your  own  so]ware  structures   –  E.g.  Use  Lambda’s  instead  of  a  Template  or  Strategy   pa^ern   •  Learn  to  read  Javadoc  for  Lambda’s   etc.)  
  9. 9. When  to  apply     Virtual  Extension  Methods     •  Use  Virtual  Extension  Methods  to  make  new  addiJons  to  your   API  backwards  compaJble     •  Add  useful  default  implementaJons  to  your  interfaces   –  E.g.  Comparator:  boolean gt(T other), boolean lt(T other)! •  Bundle  cross-­‐cuang  behaviour  in  interfaces  with  default   methods   –  E.g.  Logging  
  10. 10. Q  &  A     Urs  Peter   upeter@xebia.com   @urs_peter      

×