BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Oracle Unveils Project Avatar at JavaOne

Oracle Unveils Project Avatar at JavaOne

This item in japanese

Lire ce contenu en français

Oracle announced the open source release of Project Avatar during the JavaOne conference this past week. Avatar is a web application framework that is focused on building "modern HTML5 applications", while assuming "minor JavaScript knowledge" from application developers.

Project Avatar was originally announced at JavaOne in 2011, with the goal to share data between HTML5-based clients and cloud-based Java EE services. In an interview with Anil Gaur, Oracle's Vice President of Software Development, Gaur noted that Avatar's intent is to ensure that "Java remains the most productive environment for building HTML 5 application." The building blocks for Avatar were developed with the goal to satisfy the emerging cloud computing environment, and during QCon NY in 2012, Arun Gupta presented Avatar as a "Complete Solution for Dynamic Rich Clients."

Applications built with Avatar are designed to run inside of a Java EE 7 compliant container on top of a Java 8 runtime environment. The framework aims to simplify the development of HTML5-based applications by abstracting the code required for client-to-server communications. Additionally, widgets and data binding are made available for view-layer components to simplify the handling of data in the front-end JavaScript. The framework encourages developers to utilize the Java EE container's Expression Language (EL) to work with dynamic content returned from the server. According to the project's documentation, "the use of EL expressions eliminates the need for writing controller logic in JavaScript in order to make the page dynamic."

Avatar makes use of Java 8's Nashorn ECMAscript implementation in working with server-side JavaScript code. Service components written in JavaScript are extended by the Avatar Scripting Container (Avatar.js), which integrates the service with the application context. The framework's support for JavaScript on the server is driven by the notion that "JavaScript has a vastly expanded role" in enterprise web development. The project notes that the "variety [of client frameworks] in this space is now bewildering and expanding at an extremely rapid pace," which assumes a "very strong JavaScript skill set" from developers. According to the project, that assumption is something that is "unusual for enterprise developers".

The framework has dubbed its structural pattern a "Thin Server Architecture," which it defines as moving "all of the UI logic of a web application -- model, view and controller -- from the server to the client." In this architecture, the back-end's responsibility is shifted from "hosting application controller logic" to serving data across "standard protocols such as REST [and] WebSockets … which are available to browser based clients."

The client-side aspects of Avatar are designed with the intent to separate responsibilities of the view components from the application's service layer logic. The project states that "view and service components are not tightly coupled so developers can opt to use them à la carte." The view layer of Avatar is developed with HTML5 and offers shorthands to implement "Single Page Application" functionality, while requiring only "minimal JavaScript code." According to the documentation, developers need only know how to "copy and modify example code" to build their views.

Avatar's source code is freely available from the project's git repository, and many example applications are offered in the tutorial section of the documentation.

Rate this Article

Adoption
Style

BT