andreas enbohm capgemini sverige ab java se 7 (dolphin) or ”the future is nigh”

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

Upload: stanley-doyle

Post on 02-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

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

Andreas EnbohmCapgemini Sverige AB

Java SE 7 (Dolphin)

or

”The Future is Nigh”

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

© 2004 Capgemini - All rights reserved2008, 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 …)- JSR 284 – Resource Consumption (like ARM)- Pruning

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

© 2004 Capgemini - All rights reserved2008, 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.*;}

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

© 2004 Capgemini - All rights reserved2008, 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)

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

© 2004 Capgemini - All rights reserved2008, July – Andreas Enbohm

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)- 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

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

© 2004 Capgemini - All rights reserved2008, 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 (@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

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

© 2004 Capgemini - All rights reserved2008, July – Andreas Enbohm

Swing application Framework

Application lifecycle handling;- launch()- startup()- exit()- shutdown()

ActionPerformed -> @Action

@Action 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)

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

© 2004 Capgemini - All rights reserved2008, July – Andreas Enbohm

Annotation on Types

public int doStuff(@notNull String name) {

//No need to throw IllegalArgumentException! return name.length();

}

public void doStuff2(@notNegative int age) {

this.age = age;

}

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

© 2004 Capgemini - All rights reserved2008, 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)

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

© 2004 Capgemini - All rights reserved2008, 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 );

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

© 2004 Capgemini - All rights reserved2008, 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)

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

© 2004 Capgemini - All rights reserved2008, 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)