Java EE 7 is a step towards moving the Enterprise platform to a cloud-computing platform. Until we get to the next standard, Java EE 7 offers HTML5 productivity, and it delivers new features such as WebSocket, asynchronous communications over Servlets, RESTful endpoints, and Concurrent Utilities.
I like to focus on few important features been introduced in JavaEE7:
- Java API for WebSocket
- Java API for JSON Processing
- Java API for RESTful Web Services
- Servlet 3.1
- Bean Validation
1. Java API for WebSocket
The HTML5 specification defines WebSocket as a communication channel which operated on WWW (World Wide Web) in a full duplex mode.
Java API for WebSocket specification allows Java enterprise applications to communicate with the new HTML5 WebSocket protocol.
The Java API for WebSocket defines how to write a standard based application. It allows programmers to use either Annotation or Programmatic Endpoints. With a few lines of code websocket server been ready. Is it worth to try??
2. Java API for JSON Processing
JSON is a data exchange format widely used in web services and other connected applications. JSON Java API provides an API to parse, transform, and query JSON data using the object model or the streaming model.
Without using external API/framework, it is easy for developer to serialize & de-serialize JSON data in Java EE application.
3. Java API for RESTful Web Services
From a very small application to social networking site (facebook, twitter, etc) adapted a RESTful Web Services for exposing their functionalities to the world. The reasons behind this are:
- Platform independent
- Language Independent
- Open standard for exchanging data
- Light weighted
- Many more…
Java EE 7 stack provides an API for writing an application for building RESTful services.
The JAX-RS 2.0 specification has the following new features:
- Client-side API for invoking RESTful server-side remote endpoint
- Support for Hypermedia linkage
- Tighter integration with the Bean Validation framework
- Asynchronous API for both server and client-side invocations
- Container filters on the server side for processing incoming requests and outbound responses
- Client filter on the client side for processing outgoing request and incoming responses
- Reader and writer interceptors to handle specific content types
4. Servlet 3.1
Java Servlet is perhaps one of the oldest application programming interfaces for running Java on a web application server. It is a server endpoint for HTTP Communication.
Features been introduced:
- Align with Java EE 7 for cloud support
- For web container there will be a virtual server mapping per tenant
- Provides ability to scale using NIO2 API
- Support newer technologies to leverage http protocol for the initial handshake
- Support general upgrade mechanism for protocol like WebSocket
- Security Enhancement
- When we talk about web, the system should provide a strong security mechanism. JavaEE 7 stack provides the mechanism.
5. Bean Validation
In object oriented programming, we are mostly familiar with value objects, which are types that have encapsulation of data and accessibility operators. Value objects generally do not have business rules and thus they are represented a Plain-Old-Java-Objects (POJOs). Java Beans means value objects in java.
The focus of Bean Validation API 1.1 is ease-of-use. The expert group designed the update so that developers can apply a single constraint for multiple layers of their applications. These constraints can be applied at the presentation layer, at the business layer where your logic works, and of course the data storage layer. With Bean Validation, developers need to define the constraints only once, and then inside the application you invoke the validation anywhere you want to check.
Advantages over other traditional frameworks like Spring, Strut:
- No need of external API almost all required functionalities been achieved by the stack.
- Less footprint of binary file (JAR, WAR or EAR), as there are a few or none external API required.
- Based on standards
- Having a vast community working on the stack
- Better support for the stack
In a nutshell, Java EE 7 provides a platform to build a scalable, maintainable, secure, standardized, multi featured application.