Tomorrow Java
novidades, tendências e espectativas




                     Rafael Carneiro e Silveira Neto
agenda

         ●   java 7
         ●   java EE 6
         ●   cadeia alimentar
         ●   javaFX
fork/join framework

class Fibo extends RecursiveTask<Integer>{
    final int n;
    public Fibo(int n){this.n=n;}
    protected Integer compute(){
        if(n<=1) return n;
        Fibo f1 = new Fibo(n-1); f1.fork();
        Fibo f2 = new Fibo(n-2);
        return f2.compute() + f1.join();
    }
}
uso

public class Main {
    public static void Main(String args[]){
        ForkJoinPool pool = new ForkJoinPool(3);
        Fibo fibonacci = new Fibo(20);
        pool.execute(fibonacci);
        System.out.println(fibonacci.join());
    }
}
exception handling


try {
    /// ...
} catch (Exception1 e1, Exception2 e2) {
    // ...
} catch (Exception3 e3) {
    // ...
}
case switch


String s = ...
switch(s){
    case “dog”: ...
    break;
    case “cat”:    ...
    break;
    default: ...
    break;
}
type inference


Antes:
Map<String, Integer> map = new HashMap<String,
  Integer>();


Agora:
Map<String, Integer> map = new HashMap<>();
outras novidades


●   Modularização
●   Nova coleta de lixo (G1).
●   Ponteiros de 64 bits comprimidos.
●   InvokeDynamic
mas não


●   Closures
●   Generics refinados
●   Sobrecarga de operador
●   Sintaxe BigDecimal
●   Suporte a XML a nível de linguagem
Java EE 6


●   Contexts and Dependency Injection for Java
    (Web Beans 1.0)
●   Java Servlet 3.0
●   JavaServer Faces 2.0
●   Enterprise JavaBeans 3.1
●   Java Persistence 2.0
@Stateless @Entity @WebServlet(urlPatterns = "/monster")
   @Table(name = "MONSTERTABLE")
   @NamedQueries({@NamedQuery(name = "MonsterEJB...
   @PersistenceContext(name = "monster..."
   public class MonsterServlet extends
     HttpServlel{ @Id @GeneratedValue
      (strategy = ... private int monsterId;
   @Max(2) @NotNull private String name;
   @Transient @EJB MonsterServlet monsterEJB;




Por Ludovic Champenois, http://weblogs.java.net/blog/ludo/archive/2009/05/worst_ever_java.html
cadeia alimentar




     VMWare           Oracle



Sun Microsystems
                   Spring Source
VMWare compra SpringSource
Oracle compra Sun Microsystems
JavaFX
Prós
Contras
Imagens
●   Jeff Kubina, “Coffe Beans”
     –   http://www.flickr.com/photos/kubina/1469914113/
●   Jeff Kubina, “Coffe Bean”
     –   http://www.flickr.com/photos/kubina/1470771024/
●   Marcelo Alves, “Coffee”
     –   http://www.flickr.com/photos/xfer/4124684
●   Sjdunphy, “The Roscommon Spaghetti Incident”
     –   http://www.flickr.com/photos/sjdunphy/531657318/
●   Joh Hason, “fish soup”
     –   http://www.flickr.com/photos/jonhanson/56968305/
●   Skalas2 “axis n allies world in war”
     –   http://www.flickr.com/photos/skalasinc/356616846/
●   Alexkerhead, “Cameras and Misc in the Case”
     –   http://www.flickr.com/photos/alexkerhead/3088082405/
mais
●   Edans, “La escalera del Hotel Velázquez”
     –   http://www.flickr.com/photos/edans/499371992/
●   E's “coffee break”
     –   http://www.flickr.com/photos/e-ta-i/6148059/
●   AnantaB “2008, New Year Fireworks”
     –   http://www.flickr.com/photos/anantablamichhane/2152606721/
●   Clearly Ambiguous, “Fireworks”
     –   http://www.flickr.com/photos/clearlyambiguous/183629188/
●   Vidalia_11, “Texture - cracked paint”
     –   http://www.flickr.com/photos/56832361@N00/2476826198/
●   BigTallGuy, “Fun @ 10mm”
     –   http://www.flickr.com/photos/bigtallguy/2492489993/
algumas referências
●   JDK7 Features
     –   http://openjdk.java.net/projects/jdk7/features/
●   Deep Dive: JDK 7 With Danny Coward
     –   http://java.sun.com/developer/media/deepdivejdk7.jsp
●   SpringSource: Chapter Two
     –   http://blog.springsource.com/2009/08/10/springsource-chapter-two/
●   New features of java7SE presentation
     –   http://www.slideshare.net/dogangoko/new-features-of-java7-se-presentation
●   What's Expected in Java 7
     –   http://www.slideshare.net/gal.marder/whats-expected-in-java-7-1116123
valeu!




slides em http://silveiraneto.net

Tomorrow Java

  • 1.
    Tomorrow Java novidades, tendênciase espectativas Rafael Carneiro e Silveira Neto
  • 2.
    agenda ● java 7 ● java EE 6 ● cadeia alimentar ● javaFX
  • 3.
    fork/join framework class Fiboextends RecursiveTask<Integer>{ final int n; public Fibo(int n){this.n=n;} protected Integer compute(){ if(n<=1) return n; Fibo f1 = new Fibo(n-1); f1.fork(); Fibo f2 = new Fibo(n-2); return f2.compute() + f1.join(); } }
  • 4.
    uso public class Main{ public static void Main(String args[]){ ForkJoinPool pool = new ForkJoinPool(3); Fibo fibonacci = new Fibo(20); pool.execute(fibonacci); System.out.println(fibonacci.join()); } }
  • 5.
    exception handling try { /// ... } catch (Exception1 e1, Exception2 e2) { // ... } catch (Exception3 e3) { // ... }
  • 6.
    case switch String s= ... switch(s){ case “dog”: ... break; case “cat”: ... break; default: ... break; }
  • 7.
    type inference Antes: Map<String, Integer>map = new HashMap<String, Integer>(); Agora: Map<String, Integer> map = new HashMap<>();
  • 8.
    outras novidades ● Modularização ● Nova coleta de lixo (G1). ● Ponteiros de 64 bits comprimidos. ● InvokeDynamic
  • 9.
    mas não ● Closures ● Generics refinados ● Sobrecarga de operador ● Sintaxe BigDecimal ● Suporte a XML a nível de linguagem
  • 10.
    Java EE 6 ● Contexts and Dependency Injection for Java (Web Beans 1.0) ● Java Servlet 3.0 ● JavaServer Faces 2.0 ● Enterprise JavaBeans 3.1 ● Java Persistence 2.0
  • 11.
    @Stateless @Entity @WebServlet(urlPatterns= "/monster") @Table(name = "MONSTERTABLE") @NamedQueries({@NamedQuery(name = "MonsterEJB... @PersistenceContext(name = "monster..." public class MonsterServlet extends HttpServlel{ @Id @GeneratedValue (strategy = ... private int monsterId; @Max(2) @NotNull private String name; @Transient @EJB MonsterServlet monsterEJB; Por Ludovic Champenois, http://weblogs.java.net/blog/ludo/archive/2009/05/worst_ever_java.html
  • 12.
    cadeia alimentar VMWare Oracle Sun Microsystems Spring Source
  • 13.
  • 15.
    Oracle compra SunMicrosystems
  • 16.
  • 17.
  • 18.
  • 19.
    Imagens ● Jeff Kubina, “Coffe Beans” – http://www.flickr.com/photos/kubina/1469914113/ ● Jeff Kubina, “Coffe Bean” – http://www.flickr.com/photos/kubina/1470771024/ ● Marcelo Alves, “Coffee” – http://www.flickr.com/photos/xfer/4124684 ● Sjdunphy, “The Roscommon Spaghetti Incident” – http://www.flickr.com/photos/sjdunphy/531657318/ ● Joh Hason, “fish soup” – http://www.flickr.com/photos/jonhanson/56968305/ ● Skalas2 “axis n allies world in war” – http://www.flickr.com/photos/skalasinc/356616846/ ● Alexkerhead, “Cameras and Misc in the Case” – http://www.flickr.com/photos/alexkerhead/3088082405/
  • 20.
    mais ● Edans, “La escalera del Hotel Velázquez” – http://www.flickr.com/photos/edans/499371992/ ● E's “coffee break” – http://www.flickr.com/photos/e-ta-i/6148059/ ● AnantaB “2008, New Year Fireworks” – http://www.flickr.com/photos/anantablamichhane/2152606721/ ● Clearly Ambiguous, “Fireworks” – http://www.flickr.com/photos/clearlyambiguous/183629188/ ● Vidalia_11, “Texture - cracked paint” – http://www.flickr.com/photos/56832361@N00/2476826198/ ● BigTallGuy, “Fun @ 10mm” – http://www.flickr.com/photos/bigtallguy/2492489993/
  • 21.
    algumas referências ● JDK7 Features – http://openjdk.java.net/projects/jdk7/features/ ● Deep Dive: JDK 7 With Danny Coward – http://java.sun.com/developer/media/deepdivejdk7.jsp ● SpringSource: Chapter Two – http://blog.springsource.com/2009/08/10/springsource-chapter-two/ ● New features of java7SE presentation – http://www.slideshare.net/dogangoko/new-features-of-java7-se-presentation ● What's Expected in Java 7 – http://www.slideshare.net/gal.marder/whats-expected-in-java-7-1116123
  • 22.