Andreas Enbohm Capgemini Sverige AB Java SE 7 (Dolphin) or ”The Future is Nigh”
© 2004 Capgemini - All rights reserved 2008, July – Andreas Enbohm Java SE 7 No JSR for Java 7! Modularity - JSR 294 – Superpackages - JSR-277 Java Module System (OSGi, superjars) Libraries - JSR NIO2 (permissions, file attributes) - JSR 310 – Date and Time (3:rd time …) - JSR 284 – Resource Consumption (like ARM) - Pruning
© 2004 Capgemini - All rights reserved 2008, July – Andreas Enbohm Super Packages ”Public is too public” superpackage jdk { member package java.util; member package java.io; member package sun.io; // Impl detail export java.util.*; // Public API export java.io.*; }
© 2004 Capgemini - All rights reserved 2008, July – Andreas Enbohm Java SE 7 No JSR for Java 7! Modularity - JSR 294 Superpackages - JSR 277 Java Module System (OSGi, superjars) Libraries - JSR 203 NIO2 (permissions, file attributes) - JSR 310 Date and Time (3:rd time, datum utan klockslag) - JSR 284 Resource Consumption Management (cpu time, open JDBC connections, like ARM)
© 2004 Capgemini - All rights reserved 2008, July – Andreas Enbohm Java SE 7 Swing - JSR 296 Swing Application Framework - JSR 295 Beans Bindings - JSR 303 Beans Validation = 2, max = 4)) - Java Media Component (quicketime, mpeg 4, native) - JavaFX Types and Generics - Refined generics (puh!) - Type literals (generics at runtime) - Type Inference (String s = new String(”s”);-> s = new String) - JSR 208 Annotation on types
© 2004 Capgemini - All rights reserved 2008, July – Andreas Enbohm Java SE 7 Swing - JSR 296 Swing Application Framework - JSR 295 Beans Bindings (auto synch Model and View ) - JSR 303 Beans Validation = 1, max = 3) - Java Media Component (quicketime, mpeg 4, native) Types and Generics - Refined generics (puh!) - Type literals (generics at runtime) - Type Inference (String s = new String(”s”);-> s = new String) - JSR 208 – Annotation on types
© 2004 Capgemini - All rights reserved 2008, July – Andreas Enbohm Swing application Framework Application lifecycle handling; - launch() - startup() - exit() - shutdown() public void openFile() { …} Support for handling resources (formatted strings, images, colors, i18n) Support for session states Remove the ’italian-style-code’ which is needed in Swing applications (e.g. listener pattern)
© 2004 Capgemini - All rights reserved 2008, July – Andreas Enbohm Annotation on Types public int String name) { //No need to throw IllegalArgumentException! return name.length(); } public void int age) { this.age = age; }
© 2004 Capgemini - All rights reserved 2008, July – Andreas Enbohm Java SE 7 Language Proposals - Closures (N/A ?) - ARM blocks - Language level XML support - JavaBeans Properties (like Scala/C#, no need for get/set) Misc. Language Changes - BigDecimal operator support (+-*/) - String in switch statements - improved catch-blocks (catch (AccesEx | IllegalStateEx)) - chained method invocations (foo.bar().baz(), bar(), baz() voids)
© 2004 Capgemini - All rights reserved 2008, July – Andreas Enbohm Closures System.out.print(“Prepare the lobster"); putInPot("lobster"); putInPot("water"); System.out.print(“Prepare the chicken"); putInFryPan("chicken"); putInFryPan("coconut"); function cook( i1, i2, f ) { System.out.print(“Prepare the " + i1); f(i1); f(i2); } cook( "lobster", "water", putInPot ); cook( "chicken", "coconut", putInFryPan );
© 2004 Capgemini - All rights reserved 2008, July – Andreas Enbohm Java SE 7 Language Proposals - Closures (N/A ?) - ARM blocks - Language level XML support - JavaBeans Properties (like Scala/C#, no need for get/set) Misc. Language Changes - BigDecimal operator support (+-*/) - String in switch statements - improved catch-blocks (catch (AccesEx | IllegalStateEx)) - chained method invocations (foo.bar().baz(), bar(), baz() voids)
© 2004 Capgemini - All rights reserved 2008, July – Andreas Enbohm Java SE 7 JVM - invokedynamic (good for scriptlanguages builders) - tired compilation (improve JIT, do at startup) - G1 Garbage Collector (’collect where it is most needed’) - More script engines - Cheap concurrency -> Scala/Erlang Actors (continuation closure)