Sunteți pe pagina 1din 31

<Insert Picture Here>

To Java SE 8, and Beyond


(Plan B)
Francisco Morero Peyrona
EMEA Java Community Leader
11-1-1!
8
9
2020? ...2012
Priorities "or t#e Java Plat"or$s
%ro& 'evelo(er Base
%ro& )do(tion
Increase *o$(etitiveness
)da(t to c#an+e
,
,
Evolvin+ t#e -an+ua+e
From Evolving the Java Language - JavaOne 2005
Java language principles

Reading is more important than writing

Code should e a !oy to read

"he language should not hide what is happening

Code should do what it seems to do

Every #good$ %eature adds more #ad$ weight

&ometimes it is est to leave things out

&implicity matters
Ho& Java Evolves and )da(ts
'% the community( y the community( %or the community
.
.
8
J'/ 8 0 Pro(osed *ontent
8
8
Language
1
1
Bi+ 'isclai$er
"he synta) used in the
%ollowing slides may
change
-a$2da E3(ressions I
Closures and Functional Programming
* Lamda e)pressions provide anonymous %unction types to Java
* "hey replace the use o% single astract method types +&AM,
* "hey are !ust instances o% Runnale
Argument List Arrow "o-en .ody
+int )( int y, /0 ) 1 y
Synta3
+a, A single e)pression2 ody is evaluated and result value returned3
+, &tatement loc-2 ody is evaluated as a method ody and #return$ statement
returns control to the caller3
.ody can e2
-a$2da E3(ressions II
Closures and Functional Programming
Runnable r = () ->
{ System.out.println( "I'm a Runnable!" ); };
r.run();
jbutton.addActionListener(
e -> { System.out.println( "Clicked" ); } );
* n -> n % 2 != 0;
* (char c) -> c == 'y';
* (x, y) -> x + y;
* (int a, int b) -> a * a + b * b;
* () -> { return 3.14 };
* (String s) ->
{ System.out.println(s); };
* "ype o% parameters can e e)plicitly declared or ta-en %rom conte)t3
* Argument parenthesis are optional when there is only one and its type
can e in%erred3
* Argument List can e empty( i% it is so( parenthesis must e)ist3
* 4% ody has more that one statement( then curly races are needed3
-a$2da E3(ressions III
Closures and Functional Programming
E3tension 4et#ods
.ringing Multiple 4nheritance to Java
*
Provide a mechanism to add new methods to e)isting inter%aces
* 5ithout rea-ing ac-wards compataility
* 6ives Java multiple inheritance
(u2lic inter"ace Set<T> e3tends *ollection<T>
5
(u2lic int si6e()7
88 999 T#e rest o" t#e e3istin+ Set $et#ods
(u2lic T reduce( :educer<T> r ) de"ault *ollections9<T>set:educer7
;
)nnotations on Java Ty(es
public void process(@notnull List data) {}
* Annotations can currently only e used on type declarations
* Classes( methods( variale de%initions
* E)tension %or places where types are used
* e3g3 Parameters
* Permits error detection y pluggale type chec-ers
* e3g3 null pointer errors( race conditions( etc
)ccess to Para$eter <a$es at :unti$e
* Mechanism to retrieve parameter names o% methods and
constructors
* At runtime via core re%lection
*
4mproved code readaility
* Eliminate redundant annotations
* 4mprove 47E capailities
* Auto/generate template code
S$all T#in+s
* Repeating annotations
Multiple annotations with the same type applied to a single program element
* 8o more apt tool and associated AP4
Complete the transition to the J&R 9:9 implementation
* 7oc"ree AP4
Provide access to the syntactic elements o% a !avadoc comment
* 7ocLint tool
;se 7oc"ree AP4 to identi%y asic errors in !avadoc comments
* Javadoc support in javax.tools
4nvo-e !avadoc tools %rom AP4 as well as command line<e)ec
Lirary
*oncurrency =(dates
* &calale update variales

DoubleAccumulator( DoubleAdder( etc

Multiple variales avoid update contention

6ood %or %re=uent updates( in%re=uent reads


* ConcurrentHas!ap updates

4mproved scanning support( -ey computation


* "or#$oin%ool improvements

Completion ased design %or 4' ound applications

"hread that is loc-ed hands wor- to thread that is running


Bul> 'ata ?(erations "or *ollections
*
Adding 38et %unctionality
* L48> style processing
* &erial and parallel implementations
*
6enerally e)pressed with Lamda statements
*
Parallel implementation uilds on For-/Join %ramewor-
'ate and Ti$e )PIs
* A new date( time( and calendar AP4 %or the Java &E plat%orm
* &upports standard time concepts
* Partial( duration( period( intervals
* date( time( instant( and time/?one
*
4nitially provides a limited set o% calendar systems and will e
e)tensile to others
*
;ses relevant standards( including 4&'/8:@A( CL7R( and .CPBC
* .ased on an e)plicit time/scale with a connection to ;"C
J'B* ,9
Minor enhancements %or usaility and portaility
* Add setter<update methods
*
&esult'et( %repared'tatement and Callable'tatement
*
&upport new data types such as those eing de%ined in J&R DA@
*
REFEC;R&'R support %or Callable'tatement
*
E)tended Database!etaData.(et)ndex)n*o
*
new columns %or CAR748AL4"F and PA6E& which return a long value
* 8ew Database!etaData method
*
(et!axLo(icalLob'i+e
*
Return the logical ma)imum si?e %or a L'.
S$all (or (er#a(s not) t#in+s
* Enhance core liraries with Lamdas +not small thing,
* Parallel array sorting +improve )B,
* .ase :B Encoding and 7ecoding +no need o% undocumented AP4,
* Charset implementation improvements

Reduced si?e o% charsets

4mproved per%ormance o% encoding<decoding

Reduced core/lirary memory usage


* Reduced o!ect si?e( disale re%lection compiler( internal tale si?es
* 'ptimi?e java.text.Decimal"ormat.*ormat +improve )A@@ or )A@@@,
* &tatically Lin-ed J84 Liraries +needed %or emedded applications,
* Gandle %re=uent Has!ap collisions with alanced trees
!
!
9333
Java SE 1 (and 2eyond@)
AisionB Intero(era2ility
* 4mproved support %or non/Java languages
* 4nvo-edynamic +done,
* Java<Java&cript interop +in progress H J7I 8,
* Meta/o!ect protocol +J7I 9,
* Long list o% JJM optimi?ations +J7I 91,
* Java<8ative
* Calls etween Java and 8ative without J84 oilerplate +J7I 9,
AisionB *loud
* Multi/tenancy +J7I 81,
* 4mproved sharing etween JJMs in same '&
* Per/thread<threadgroup resource trac-ing<management
* Gypervisor aware JJM +J7I 91,
* Co/operative memory page sharing
* Co/operative li%ecycle( migration
AisionB -an+ua+e Ceatures
* Large data support +J7I 9,
* Large arrays +:B it support,
* ;ni%ied type system +J7I A@1,
* 8o more primitives( ma-e everything o!ects
* 'ther type rei%ication +J7I A@1,
* "rue generics
* Function types
* 7ata structure optimi?ations +J7I A@1,
* &tructs( multi/dimensional arrays( etc
* Close last+K, per%ormance gap to low/level languages
AisionB Inte+ration
* Modern device support +J7I 81,
* Multitouch +J7I 81,
* Location +J7I 81,
* &ensors H compass( accelerometer( temperature( pressure( 333 +J7I 81,
*
Geterogenous compute models +J7I 91,
* Java language support %or 6P;( FP6A( o%%load engines( remote PL<&>L333
T#e Pat# Cor&ard (J'/ 1D)
*
'pen development
* Prototyping and RL7 in 'penJ7I
* Cooperate with partners( academia( greater community
*
5or- on ne)t J7I( %uture %eatures in parallel
* 9/year cycle %or Java &E releases
Java SE "ro$ J'/ E to J'/ 1
D11 D11 D1F D1F D11 D11 D1, D1,
J'/ E J'/ E
D1! D1!
D1 D1
J'/ 1 J'/ 1
D1E D1E
J'/ 8 J'/ 8
J'/ 1 J'/ 1
J'/ 1D J'/ 1D J'/ 11 J'/ 11
D1 D1
JA4 conver+ence
4ac ?S G
JA4 conver+ence
4ac ?S G

S-ar putea să vă placă și