Java SE 7 Dolphin or The Future is

  • Slides: 12
Download presentation
Java SE 7 (Dolphin) or ”The Future is Nigh” Andreas Enbohm Capgemini Sverige AB

Java SE 7 (Dolphin) or ”The Future is Nigh” Andreas Enbohm Capgemini Sverige AB

Java SE 7 No JSR for Java 7! Modularity - JSR 294 – Superpackages

Java SE 7 No JSR for Java 7! Modularity - JSR 294 – Superpackages - JSR-277 Java Module System (OSGi, superjars) Libraries - JSR 203 - NIO 2 (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

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 -

Java SE 7 No JSR for Java 7! Modularity - JSR 294 Superpackages - JSR 277 Java Module System (OSGi, superjars) Libraries - JSR 203 NIO 2 (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

Java SE 7 Swing - JSR 296 Swing Application Framework - JSR 295 Beans Bindings - JSR 303 Beans Validation (@length(min = 2, max = 4)) - Java Media Component (quicketime, mpeg 4, native) - Java. FX 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

Java SE 7 Swing - JSR 296 Swing Application Framework - JSR 295 Beans Bindings (auto synch Model and View ) - JSR 303 Beans Validation (@length(min = 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()

Swing application Framework Application lifecycle handling; - launch() - startup() - exit() - shutdown() Action. Performed -> @Action public void open. File() { …} Support for handling resources (formatted strings, images, colors, i 18 n) 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 do. Stuff(@not. Null String name) { //No need to

Annotation on Types public int do. Stuff(@not. Null String name) { //No need to throw Illegal. Argument. Exception! return name. length(); } public void do. Stuff 2(@not. Negative int age) { this. age = age; } © 2004 Capgemini - All rights reserved 2008, July – Andreas Enbohm

Java SE 7 Language Proposals - Closures (N/A ? ) - ARM blocks -

Java SE 7 Language Proposals - Closures (N/A ? ) - ARM blocks - Language level XML support - Java. Beans Properties (like Scala/C#, no need for get/set) Misc. Language Changes - Big. Decimal operator support (+-*/) - String in switch statements - improved catch-blocks (catch (Acces. Ex | Illegal. State. Ex)) - 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"); put. In. Pot("water"); System. out. print(“Prepare the chicken");

Closures System. out. print(“Prepare the lobster"); put. In. Pot("water"); System. out. print(“Prepare the chicken"); put. In. Fry. Pan("coconut"); function cook( i 1, i 2, f ) { System. out. print(“Prepare the " + i 1); f(i 2); } cook( "lobster", "water", put. In. Pot ); cook( "chicken", "coconut", put. In. Fry. Pan ); © 2004 Capgemini - All rights reserved 2008, July – Andreas Enbohm

Java SE 7 Language Proposals - Closures (N/A ? ) - ARM blocks -

Java SE 7 Language Proposals - Closures (N/A ? ) - ARM blocks - Language level XML support - Java. Beans Properties (like Scala/C#, no need for get/set) Misc. Language Changes - Big. Decimal operator support (+-*/) - String in switch statements - improved catch-blocks (catch (Acces. Ex | Illegal. State. Ex)) - 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

Java SE 7 JVM - invokedynamic (good for scriptlanguages builders) - tired compilation (improve JIT, do at startup) - G 1 Garbage Collector (’collect where it is most needed’) - More script engines - Cheap concurrency -> Scala/Erlang Actors (continuation closure) © 2004 Capgemini - All rights reserved 2008, July – Andreas Enbohm