Friday Jul 19, 2013

Java API for JSON Processing: An Introduction to JSON

A new article, now up on otn/java, by Oracle’s Jitandra Kotamraju, titled “Java API for JSON Processing: An Introduction to JSON,” takes a look at how Java API for JSON Processing provides portable APIs to parse, generate, transform and query JSON, also known as JavaScript Object Notation. Kotamraju, a principal member of the technical staff at Oracle, is the JSON Processing specification lead.

JSO, a lightweight, text-based, language-independent data exchange format that is easy to read and write by both humans and machines, can represent two structured types: objects and arrays. Kotamraju, the JSON Processing specification lead, explains that “an object is an unordered collection of zero or more name/value pairs. An array is an ordered sequence of zero or more values. The values can be strings, numbers, booleans, null and these two structured types.”

JSON is frequently used in Ajax applications, configurations, databases, and RESTful web services. JSON is offered as the data exchange format with their RESTful web services by all popular websites.

Kotamraju gets under the hood with both the object model and streaming APIs. He concludes that the API for JSON Processing offers the following capabilities:
* “Parsing input streams into immutable objects or event streams
* Writing event streams or immutable objects to output streams
* Programmatically navigating immutable objects
* Programmatically building immutable objects with builders”

The API forms a base for building data binding, transformation, querying, or other manipulation APIs. JAX-RS 2.0 provides native integration for the Java API for JSON Processing.

Check out the article here.

Wednesday May 22, 2013

What's New in JMS 2.0: Ease of Use

A new article by Oracle’s Nigel Deakin, up on otn/java, titled “What's New in JMS 2.0, Part One: Ease of Use,” demonstrates ways in which JMS 2.0 enables developers to send and receive messages while writing less code. Some features of JMS 2.0, part of Java EE 7, and can be deployed in Java EE Web or EJB applications, while others can only be used standalone in a Java SE environment.

Deakin writes:

“The single biggest change in JMS 2.0 is the introduction of a new API for sending and receiving messages that reduces the amount of code a developer must write. For applications that run in a Java EE application server, the new API also supports resource injection. This allows the application server to take care of the creation and management of JMS objects, simplifying the application even further…”

The new API, known as the “simplified” API, is simpler and easier to use than the existing JMS 1.1 API, now known as the “classic” API.

Deakin describes the new API as follows:

“The simplified API consists of three new interfaces: JMSContext, JMSProducer, and JMSConsumer:

* JMSContext replaces the separate Connection and  Session objects in the classic API with a single object.

* JMSProducer is a lightweight replacement for the MessageProducer object in the classic API. It allows message delivery options, headers, and properties to be configured using method chaining (sometimes known as a builder pattern).

* JMSConsumer replaces the MessageConsumer object in the classic API and is used in a similar way.”

Developers can now choose between the two APIs and have access to both the classic and new features. Stay tuned for Part Two, in which Deakin will explore new messaging features in JMS 2.0.

Check out Part One here.

Monday Apr 08, 2013

Technical Article: Java EE 7 and JAX-RS 2.0

A new article by Java Champion Adam Bien, titled “Java EE 7 and JAX-RS 2.0” is up on otn/java. The article demonstrates how Java EE 7 with JAX-RS 2.0 has several new useful features which further simplify development, and lead to the creation of more sophisticated Java SE/EE RESTful applications.

Using a Java-friendly, but simplistic JAX-RS 2.0 example Bien takes the reader through aspects, request interception, client and configuration issues and much more. He concludes the article as follows:

“Interestingly, JAX-RS does not even require a full-fledged application server. After fulfilling the specified Context Types, a JAX-RS 2.0–compliant API can be anything. However, the combination with EJB 3.2 brings asynchronous processing, pooling (and so throttling), and monitoring. Tight integration with Servlet 3+ comes with efficient asynchronous processing of @Suspended responses through AsyncContext support and CDI runtime brings eventing. Also Bean Validation is well integrated and can be used for validation of resource parameters. Using JAX-RS 2.0 together with other Java EE 7 APIs brings the most convenient (=no configuration) and most productive (=no re-invention) way of exposing objects to remote systems.”

Check out the article here.

Wednesday Feb 13, 2013

JavaFX Open Source Update!

Oracle has started to open source JavaFX, the rich client platform for Java applications. The list of open sourced projects will be growing in the next couple of weeks with an additional 7 projects. "We are also going to open source our iOS and Android implementations over the next couple of months" announced Richard Bair, architect of the JavaFX platform, in his blog.

Wednesday Jan 16, 2013

JavaFX and Java EE with Johan Vos!

Johan Vos is the co-founder and CTO of LodgOn, a company focused on “Java software for enabling communities.” In an interview, he shares his experience creating applications with JavaFX for the front-end and Java EE in the back-end. For one of clients, he created a badge-based rewarding system, which tracks user participation in social media and at events.

He sees a wealth of opportunities with JavaFX as client development platform and with Java EE as a back-end.  The challenge lies in “how you can connect the back-end servers with small devices like tablets, phones and embedded devices.” The opportunity is that “they have one thing in common which is Java”

A member of the GlassFish community, he considers JAX-RS 2.0 as an essential technology and standard. “REST interfaces and the JAX-RS API provide a standard that allows back-end applications to connect with any front-end clients”. He created the open-source project DataFX, “a JavaFX client that connects to any REST based back-end” and the open-source framework DaliCore that manages social media resources in Java EE applications. 

Watch the video interview

Thursday Sep 27, 2012

Talking JavaOne with Rock Star Raghavan Srinivas

Raghavan Srinivas, affectionately known as “Rags,” is a two-time JavaOne Rock Star (from 2005 and 2011) who, as a Developer Advocate at Couchbase, gets his hands dirty with emerging technology directions and trends. His general focus is on distributed systems, with a specialization in cloud computing. He worked on Hadoop and HBase during its early stages, has spoken at conferences world-wide on a variety of technical topics, conducted and organized Hands-on Labs and taught graduate classes.

He has 20 years of hands-on software development and over 10 years of architecture and technology evangelism experience and has worked for Digital Equipment Corporation, Sun Microsystems, Intuit and Accenture. He has evangelized and influenced the architecture of numerous technologies including the early releases of JavaFX, Java, Java EE, Java and XML, Java ME, AJAX and Web 2.0, and Java Security.

Rags will be giving these sessions at JavaOne 2012:
  • CON3570 -- Autosharding Enterprise to Social Gaming Applications with NoSQL and Couchbase
  • CON3257 -- Script Bowl 2012: The Battle of the JVM-Based Languages (with Guillaume Laforge, Aaron Bedra, Dick Wall, and Dr Nic Williams)


Rags emphasized the importance of the Cloud: “The Cloud and the Big Data are popular technologies not merely because they are trendy, but, largely due to the fact that it's possible to do massive data mining and use that information for business advantage,” he explained.

I asked him what we should know about Hadoop. “Hadoop,” he remarked, “is mainly about using commodity hardware and achieving unprecedented scalability. At the heart of all this is the Java Virtual Machine which is running on each of these nodes. The vision of taking the processing to where the data resides is made possible by Java and Hadoop.”

And the most exciting thing happening in the world of Java today? “I read recently that Java projects on github.com are just off the charts when compared to other projects. It's exciting to realize the robust growth of Java and the degree of collaboration amongst Java programmers.”

He encourages Java developers to take advantage of Java 7 for Mac OS X which is now available for download. At the same time, he also encourages us to read the caveats.

Originally published on blogs.oracle.com/javaone.

Monday Sep 10, 2012

Expressing the UI for Enterprise Applications with JavaFX 2.0 FXML - Part Two

A new article by Oracle’s Java Champion Jim Weaver, titled “Expressing the UI for Enterprise Applications with JavaFX 2.0 FXML -- Part Two,” now up on otn/java, shows developers how to leverage the power of the FX Markup Language to define the UI for enterprise applications. Weaver, the author of Pro JavaFX Platform, extends the SearchDemoFXML example used in Part One to include more concepts and techniques for creating an enterprise application using FXML.

Weaver concludes the article by summarizing its content, “FXML provides the ability to radically change the UI without modifying the controller. This task can be accomplished by loading different FXML documents, leveraging JavaFX cascading style sheets, and creating localized resource bundles. Named parameters can be used with these features to provide relevant information to an application at startup.”


Check out the article here.





Wednesday Jun 20, 2012

Expressing the UI for Enterprise Applications with JavaFX 2.0 FXML - Part One

A new article, the first of two parts, now up on otn/java by Oracle Evangelist and JavaFX expert, James L. Weaver, titled “Expressing the UI for Enterprise Applications with JavaFX 2.0 FXML, Part One,” shows developers how to leverage the power of the FX Markup Language (FXML) to define the UI in enterprise applications.

As Weaver explains, “JavaFX 2.0 is an API and runtime for creating Rich Internet Applications (RIAs). JavaFX was introduced in 2007, and version 2.0 was released in October 2011. One of the advantages of JavaFX 2.0 is that the code can be written in the Java language using mature and familiar tools.”

He goes on to show how to use the potential of FX Markup Language, which comes with JavaFX 2.0, to efficiently define the user interface for enterprise applications. FXML functions to enable the expression of the UI using XML. “Classes that contain FXML functionality are located in the javafx.fxml package,” says Weaver, “and they include FXMLLoader, JavaFXBuilderFactory, and an interface named Initializable.”

Weaver’s article offers a sample application that shows how to use the capabilities of FXML and JavaFX 2.0 to create an enterprise app.

Have a look at the article here.

Wednesday May 23, 2012

Best Practices for JavaFX 2.0 Enterprise Applications, Part Two

Java Champion, Oracle Java Evangelist, and JavaFX expert Jim Weaver, has published Part Two of his article, "Best Practices for JavaFX 2.0 Enterprise Applications" on otn/java. Weaver continues to explore the possibilities of the TweetBrowser application, focusing now on new techniques and best practices that include:

* Leveraging a JavaFX cascading style sheet
* Implementing springs and struts in the UI
* Using a ternary operation in binding expressions
* Defining JavaFX properties
* Leveraging a Popup to implement a dialog box
* Using WebView to display a Web page

As Weaver emphasizes, there is a vast array of techniques and best practices that can be used in JavaFX applications. For example:

The JavaFX cascading style sheet (CSS) enables users to modify the appearance of an application.

The springs and struts concept enables a fixed horizontal strut and a variable horizontal spring so that an application can appear the way developers want it to appear, regardless of the size of the scene or the type of platform.

Go here to learn more about the rich possibilities of JavaFX 2.0 and enterprise applications.

Monday Apr 16, 2012

Best Practices for JavaFX 2.0 Enterprise Applications

A new article, up on otn/java, by Java Champion, Oracle Java Evangelist, and JavaFX expert Jim Weaver, titled "Best Practices for JavaFX 2.0 Enterprise Applications (Part One),” explores best practices for developing enterprise applications in JavaFX 2.0.

Weaver illustrates his points by examining a sample application named TweetBrowser which contains the following:

* “A Toolbar containing a TextField and a couple of Button controls for searching and navigating tweets obtained from the Twitter REST API.
* A ListView whose cells contain representations of the tweets. Each tweet is represented by a subclass of ListCell that contains an ImageView for the profile picture and Hyperlink controls that enable the user to navigate to screen names, hashtags, and Web links.
* A ProgressIndicator that spins when a search is performed and a WebView that displays the Web page associated with a Web link in a tweet.”

The TweetBrowser project, which Weaver invites the reader to download, contains the code for the application, portions of which he highlights throughout the article. Techniques and best practices used in the TweetBrowser application include:

    “Invoking an application via Java Web Start from the application’s home page
    Ensuring only one instance of the application is started
    Binding the UI to the model”

Weaver concludes the article by observing that, “Implementing techniques such as invoking an application via Java Web Start from the application’s home page, ensuring only one instance of the application is started, and binding the UI to the model make life easier for both the user and the developer."

Please stay tuned for Part Two of this series where Jim will explore more techniques and best practices used in the TweetBrowser example application.

You'll find Part One 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
22
23
24
25
26
27
28
29
30
   
       
Today