Thursday Aug 15, 2013

Trying Out Lambda Expressions in the Eclipse IDE

A new article, now up on otn/java, by Deepak Vohra, titled “Trying Out Lambda Expressions in the Eclipse IDE,” demonstrates how to take advantage of lambda expressions in Java SE 8 using the Eclipse IDE and virtual extension methods.

Vohra begins with the basics:
“Lambda expressions, also called closures, are a short-form replacement for anonymous classes. Lambda expressions simplify the use of interfaces that declare a single abstract method, which are also called functional interfaces. In Java SE 7, a single method interface can be implemented with one of the following options.
* Create a class that implements the interface.
* Create an anonymous class.”

Vohra explains that while lambda expressions can be used to implement a functional interface without creating a class or an anonymous class, they can be used only with interfaces that declare a single method.

Benefits of lambda expressions include:
* Concise syntax
* Method references and constructor references
* Reduced runtime overhead compared to anonymous classes

Vohra gets under the hood to explain the basics of lambda syntax, along with the nature of functional interfaces and target types, offering copious examples. All in all, the article offers a first-rate primer on how to make use of lambda expressions and virtual extension methods using the Eclipse IDE.

Check out the story here.

Tuesday May 15, 2012

JSF 2.0 for the Cloud, Part Two

Part Two of Deepak Vohra’s “JSF 2.0 for the Cloud” is now up on otn/java. In Part One, Vohra demonstrated how to take advantage of resource handling, @ManagedBean annotation, and implicit navigation. In Part Two, he explores new features in JSF 2.0 that make it ready for the cloud, including Ajax support, view parameters, preemptive navigation, event handling, and bookmarkable URLs.

Ajax support for JSF 2.0 components includes asynchronous transfer of data between a client and a server, along with partial page rendering, partial page processing, and grouping of components, and can be added using either f:ajax tag or the JSF Ajax library (jsf.js).

Regarding view parameters, Vohra explains, “JSF 2.0 added support for view parameters, which add the provision to send request parameters in a GET request. A view parameter is a UI component represented with the UIViewParameter class. Just like other UI components, it is saved in the UI component tree for a Facelets page and can be associated with validators and converters. A view parameter is an EditableValueHolder because it implements the interface.”

Preemptive navigation allows developers to determine the resource file that they  navigate to and request parameters, if needed, based on the navigation case and view parameters, thus allowing them to create a URL for JSF resources that they access from a GET request. As a result, the URL displayed shows the resource and all request parameters.

Developers should take note that plans are in the works to update Java EE 7 for “cloud-related practical considerations, such as multitenancy and elasticity, also known as horizontal scaling.” This will be available through JSR 342, which is scheduled to complete an early draft review on May 23, 2012. Specification leads are Oracle’s Bill Shannon and Linda DeMichiel.
Access the article here.

Thursday Apr 12, 2012

JavaServer Faces 2.0 for the Cloud

A new article now up on otn/java by Deepak Vohra titled “JSF 2.0 for the Cloud, Part One,” shows how JavaServer Faces 2.0 provides features ideally suited for the virtualized computing resources of the cloud. The article focuses on @ManagedBean annotation, implicit navigation, and resource handling. Vohra illustrates how the container-based model found in Java EE 7, which allows portable applications to target single machines as well as large clusters, is well suited to the cloud architecture.

From the article--

“Cloud services might not have been a factor when JavaServer Faces 2.0 (JSF 2.0) was developed, but JSF 2.0 provides features ideally suited for the cloud, for example:
•    The path-based resource handling in JSF 2.0 makes handling virtualized resources much easier and provides scalability with composite components.
•    REST-style GET requests and bookmarkable URLs in JSF 2.0 support the cloud architecture. Representational State Transfer (REST) software architecture is based on transferring the representation of resources identified by URIs. A RESTful resource or service is made available as a URI path. Resources can be accessed in various formats, such as XML, HTML, plain text, PDF, JPEG, and JSON, among others. REST offers the advantages of being simple, lightweight, and fast.
•    Ajax support in JSF 2.0 is integrable with Software as a Service (SaaS) by providing interactive browser-based Web applications.”
In Part Two of the series, Vohra will examine features such as Ajax support, view parameters, preemptive navigation, event handling, and bookmarkable URLs.

Have a look at the article here.

Monday Oct 17, 2011

Java Community Keynote: Enabling Collaboration, Enabling Innovation

IBM, Java, and the Cloud

The morning JavaOne 2011 Community Keynote began with IBM, presented by Jason McGee, IBM Distinguished Engineer, Chief Architect, Cloud Computing. McGee focused on Java and Cloud computing-the challenges in the language and the JVM for running in the Cloud, how to make your applications elastic and scale well in the Cloud, and the latest innovations (driven by IBM and others) for deploying applications to the Cloud.

McGee explored several recent IBM offerings for the Cloud-including WebSphere eXtreme Scale, a Java based, in-memory data grid product for elastic scalability in Cloud environments; and IBM Workload Deployer, a Cloud deployment and management system for existing virtualized hardware. McGee ended by reiterating IBM's commitment to the Java community, noting their membership in OpenJDK as of 2010.

Community: Best Practices, Innovation, and Learning Resources

Sharat Chander, Principle Product Director, JavaOne Program Committee Chairperson, Oracle began his portion of the keynote by offering a moment of silence in respect for the passing of Apple's Steve Jobs, noting his passion and innovation in the world of technology. The Apple logo briefly appeared on the large screen.

Chander emphasized that Java isn't just about technology, it's also about community. Within this context, he first recognized Mike DeNicola, John Rose, and Patrick Curran, for their outstanding participation and leadership within the JCP this past year. And as part of ever-broadening the Java community, Chander next paid tribute to the Java Dutchess program-with over 400 groups around the world, globally connecting women in Java technology.

From there, Donald Smith, Director of Product Management, Java Platform Group, Oracle invited onstage a panel of representatives from the global Java community: Martijn Verburg, London Java Community; John Duimovich, OpenJDK; Deepak Bhole, OpenJDK; Stephen Chin, SvJugFx; and Bruno Souza, SouJava. The group noted that this was the first JavaOne conference with a community-themed keynote. In true connected community fashion, the group invited those watching the presentation to informally vote (via text message) on Java technologies and initiatives of current and future interest.

The panel members all urged active participation in Java User Groups, from both a technical and professional advancement perspective. Such community involvement not only drives open standards, they declared, but also drives innovation among vendors. The OpenJDK representatives then explored the challenges and promises of the initiative, agreeing that participants should have high expectations for openness, and to push on that. They strongly urged developers to download OpenJDK, and to use it.

Community: Moving Java Forward

Smith explored with the panel how the Java community can best take part in moving Java forward. The consensus was that the process ideally involves vision, innovation, and execution, and that the community can participate at all of these levels-getting involved via JUGs, as well as testing and submitting bug reports, and thereby helping Oracle and other Java vendors build the best and most innovative technologies. One technique being explored at some JUGs, to better facilitate participation, is to both stream them live and offer audio archives via Parleys.com. Within the context of making community content as available as possible, Oracle announced their agreement with Parleys.com to host many of the JavaOne sessions on the learning site-including video, demos, and synchronized audio/slides.

Duke's Choice Award Winners

What JavaOne would be complete without acknowledging the Duke's Choice Award Winners (this year with community input in the selection and review process). Featured onstage were representatives of Rockwell Automation, for their Java Embedded factory floor automation solutions; Sodbeans Project, for their NetBeans-based accessibility suite to aid blind software developers; and JHome, a Glassfish/Java EE-based home automation system for the control of almost any device in the home, including lamps, gates, coffee machines, and more.
Java Posse Comes to Town

To the tune of Spaghetti Western soundtrack music, representatives of the fabled Java Posse next took the stage (to Sharat Chander's mock amazement). The Java Posse site has long been known for its podcasts offering news, discussions, interviews, and "general mayhem" surrounding the world of Java. The Java Posse members emphasized what they see as the three elements of Java-the language, the platform, and (most importantly), the Java community. "We have a development community that other development platforms dream of having," they said. They promised in-depth appearances from many of the Duke's Choice Award winners. And in parting the stage, they deputized Chander as an official honorary member of the Java Posse, presenting him with a 10-gallon hat.

In closing, JavaOne participants were urged to get involved and make their voices heard-to participate in the JavaOne Community Steering Committee, to participate in the JavaOne Program Committee, to submit speaker papers, to participate in the OpenJDK project, and to join a local JUG. Chander parted by noting that JavaOne 2012 would feature a community member as one of the keynote speakers.



Learn More:

WebSphere eXtreme Scale
IBM Workload Deployer
Java Dutchess
2011 Duke's Choice Award Winners
Parleys.com
The Java Posse

Thursday Aug 18, 2011

Templating with JSF 2.0 Facelets

A new article on otn/java, “Templating with JSF 2.0 Facelets,” by Deepak Vohra, offers a concise explanation of how to use Facelets, which in JavaServer Faces (JSF) 2.0, has replaced JavaServer Pages (JSP) as the default view declaration language (VDL). With Facelets, developers no longer need to configure a view handler as they once did in JSF 1.2.

From the article itself:

“Facelets is a templating framework similar to Tiles. The advantage of Facelets over Tiles is that JSF UIComponents are pre-integrated with Facelets, and Facelets does not require a Facelets configuration file, unlike Tiles, which requires a Tiles configuration file.

JSF Validators and Converters may be added to Facelets. Facelets provides a complete expression language (EL) and JavaServer Pages Standard Tag Library (JSTL) support. Templating, re-use, and ease of development are some of the advantages of using Facelets in a Web application.

In this article, we develop a Facelets Web application in Oracle Enterprise Pack for Eclipse 11g and deploy the application to Oracle WebLogic Server 11g. In the Facelets application, an input text UIComponent will be added to an input Facelets page. With JSF navigation, the input Facelets page is navigated to another Facelets page, which displays the JSF data table generated from the SQL query specified in the input Facelets page. We will use Oracle Database 11g Express Edition for the data source. Templating is demonstrated by including graphics for the header and the footer in the input and the output; the graphics have to be specified only once in the template.”

Read the complete article here.

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