Tuesday Sep 24, 2013

Session Report: JSR 341: Expression Language 3.0

Ed Burns, Consulting Member of Technical Staff, and Kinman Chung, Principle Member of Technical Staff, both at Oracle, presented a session on Monday in which they described new features in JSR 341, Expression Language (EL) 3.0. They discussed the APIs for the use of EL in standalone environments and EL syntax for new operators, plus lambda expressions, and support for collection objects, all the while offering copious code illustrations.

Burns remarked that he was pleased that Java Champion and JavaOne Rock Star Adam Bien had referred to EL 3.0 as “the hidden gem of Java EE”. “I don’t know how hidden it is,” said Burns, “but I think it’s a gem.”

He discussed the origins of EL, which has a long and active history in the Java platform. EL began in 2004 as part of the Java Standard Tag Library (JSTL 1.0), moved to JSP 2.0 in 2006, and became an independent specification with JSR 341 in 2011. It is used in JSF, CDI, and Avatar. Now, 9 years after its inception, it is an independent specification that is heavily used in JSF.   

Burns observed that the presence of EL is the key differentiator between Java server and non-java server stacks. “Java server-based web frameworks are likely to use EL,” said Burns. “When you show someone who is not familiar with EL how easy it is to move things together from disparate parts of your application, it’s very compelling.”

The most important feature that EL 3 brings is lambda expressions – developers do not have to wait until Java SE 8 is released. It all runs on Java EE 7, which requires Java SE 7 -- which means that it is currently available. Burns gave a brief discussion of lambda expressions, which basically behave like an anonymous function -- lambdas in EL are EL expressions. They offer full access to the EL environment within the body of the EL lambda expression, something not available from Java SE lambdas. “You won’t be able to refer to other EL things from a plain old SE lambda expression,” said Burns.

The goal of EL 3 is to provide greater expressive power for applications and to use it outside of Java EE. Burns and Chung provided an overview of collection operations and explained EL’s support for stand-alone environments. EL 3 is easy to use outside of Java EE and provides standard data structures: ELContext; ELResolvers; and local variable and function repositories.

They explained that it enables direct EL operations and has: EL expression evaluation; Bean definition; and Function definition. They emphasized that other key parts of Java EE can also be used standalone, such as: Bean Validation; Persistence (JPA); and Contexts and Dependency Injection (CDI). They encouraged developers to consider the possibilities for cloud deployment in: Defining functions and variables and defining beans.

They spent the rest of the session illustrating their key points with a healthy dose of code.

Links and Downloads:
* JSR 341: http://www.jcp.org/en/jsr/detail?id=341
    Download spec and API javadocs

* Project home: https://java.net/projects/el-spec/
   Report spec bugs or RFE for el.next

* RI: https://java.net/projects/uel/
   Maven artifacts available from Maven Central
   Download source and report RI bugs

* Integrated in Glassfish 4.0: https://glassfish.java.net/

You can listen to this session in early October on Parleys.com.

Friday Nov 18, 2011

Blog Buzz - Devoxx 2011

Some day I will make it to Devoxx – for now, I’m content to vicariously follow the blogs of attendees and pick up on what’s happening.  I’ve been doing more blog "fishing," looking for the best commentary on 2011 Devoxx. There’s plenty of food for thought – and the ideas are not half-baked.

The bloggers are out in full, offering useful summaries and commentary on Devoxx goings-on.

Constantin Partac, a Java developer and a member of Transylvania JUG, a community from Cluj-Napoca/Romania, offers an excellent summary of the Devoxx keynotes.

Here’s a sample:

“Oracle Opening Keynote and JDK 7, 8, and 9 Presentation
•    Oracle is committed to Java and wants to provide support for it on any device.
•    JSE 7 for Mac will be released next week.
•    Oracle would like Java developers to be involved in JCP, to adopt a JSR and to attend local JUG meetings.
•    JEE 7 will be released next year.
•    JEE 7 is focused on cloud integration, some of the features are already implemented in glassfish 4 development branch.
•    JSE 8 will be release in summer of 2013 due to “enterprise community request” as they can not keep the pace with an 18    month release cycle.
•    The main features included in JSE8 are lambda support, project Jigsaw, new Date/Time API, project Coin++ and adding   support for sensors.

JSE 9 probably will focus on some of these features:
1.    self tuning JVM
2.    improved native language integration
3.    processing enhancement for big data
4.    reification (adding runtime class type info for generic types)
5.    unification of primitive and corresponding object classes
6.    meta-object protocol in order to use type and methods define in other JVM languages
7.    multi-tenancy
8.    JVM resource management”

Thanks Constantin!

Ivan St. Ivanov, of SAP Labs Bulgaria, also commented on the keynotes with a different focus.  He summarizes Henrik Stahl’s look ahead to Java SE 8 and JavaFX 3.0; Cameron Purdy on Java EE and the cloud; celebrated Java Champion Josh Bloch on what’s good and bad about Java; Mark Reinhold’s quick look ahead to Java SE 9; and Brian Goetz on lambdas and default methods in Java SE 8.

Here’s St. Ivanov’s account of Josh Bloch’s comments on the pluses of Java:

“He started with the virtues of the platform. To name a few:

    Tightly specified language primitives and evaluation order – int is always 32 bits and operations are executed always from left  to right, without compilers messing around
    Dynamic linking – when you change a class, you need to recompile and rebuild just the jar that has it and not the whole application
    Syntax  similarity with C/C++ – most existing developers at that time felt like at home
    Object orientations – it was cool at that time as well as functional programming is today
    It was statically typed language – helps in faster runtime, better IDE support, etc.
    No operator overloading – well, I’m not sure why it is good. Scala has it for example and that’s why it is far better for defining DSLs. But I will not argue with Josh.”

It’s worth checking out St. Ivanov’s summary of Bloch’s views on what’s not so great about Java as well.

What's Coming in JAX-RS 2.0

Marek Potociar, Principal Software Engineer at Oracle and currently specification lead of Java EE RESTful web services API (JAX-RS), blogged on his talk about what's coming in JAX-RS 2.0, scheduled for final release in mid-2012.  

Here’s a taste:

“Perhaps the most wanted addition to the JAX-RS is the Client API, that would complete the JAX-RS story, that is currently server-side only. In JAX-RS 2.0 we are adding a completely interface-based and fluent client API that blends nicely in with the existing fluent response builder pattern on the server-side. When we started with the client API, the first proposal contained around 30 classes. Thanks to the feedback from our Expert Group we managed to reduce the number of API classes to 14 (2 of them being exceptions)! The resulting is compact while at the same time we still managed to create an API that reflects the method invocation context flow (e.g. once you decide on the target URI and start setting headers on the request, your IDE will not try to offer you a URI setter in the code completion). This is a subtle but very important usability aspect of an API…”

Obviously, Devoxx is a great Java conference, one that is hitting this year at a time when much is brewing in the platform and beginning to be anticipated.


About

Insider News from the Java Team at Oracle!

duke
javeone logo
Links


Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
2
5
6
7
12
13
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today