Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

Sponsored Links

Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs

Java EE and Flex, Part 1: A compelling combination

Rich-client technology for your enterprise Java applications

  • Print
  • Feedback

Adobe Flex is becoming a popular choice for generating the client side of enterprise Java applications. In this first of two articles, Dustin Marx demonstrates how Flex can help you deliver highly interactive user interfaces that access your Java EE application's enterprise logic. Get a hands-on introduction to perfecting a simple Flex client, then enable it to communicate with your Java EE server. Level: Beginner

Flex 3 gives you another choice for building browser-based UIs for your Java EE applications. If you haven't yet discovered how simple it is to add rich clients to enterprise Java applications with Flex, this article could serve as your point of entry. You'll find out what benefits Flex brings to the table, how to create application layouts using Flex's XML grammar, and how to make your Flex client work with a Java EE application.

Java developers adopting Flex

We know that some Java developers are resistant to Flex as a front-end technology for Java EE, but there's a strong argument for giving Flex a chance. Author Dustin Marx discusses the factors driving Flex adoption in the Java community in a sidebar to this hands-on article.

Before I ask you to install Flex and start putting together a sample application, let's consider the advantages of using Flex as a client-side technology. Flex offers advantages specific to Java developers and some that are more general. We'll look at both.

Why choose Flex?

Adopting a new technology means embracing a learning curve, which can take some convincing. Here are some general advantages to using Flex:

  • You can write Flex code once and run it in any Web browser for which a Flash Player plugin exists. None of the browser-detection or object-detection code typical of JavaScript or Ajax applications is required.
  • The target runtime (Flash Player 9 or later) is installed on more than 95 percent of Web browsers worldwide.
  • Flex is based on standards. Its scripting language (ActionScript 3.0) has roots in ECMAScript (the same specification implemented by JavaScript), and its layout language is a specific XML grammar called MXML. Familiarity with the underlying standards can help you learn Flex with relative ease.
  • Flex has a refreshingly simple mechanism for binding the property of one object in a Flex application to the property of another object in Flex. This addictive feature is commonly referred to as property binding. (JSR 295: Beans Binding is intended to add this feature to the Java language, but it won't be included in Java SE 7.)
  • You can associate the Flex-based front-end with any back-end technology using techniques that promote loose coupling. Flex provides built-in support for communication with back-ends via both traditional HTTP and SOAP-based Web services.
  • Flex provides a rich set of components, Flash effects (including animation, video, and audio), and accessibility features that make it easy to add richness and highly fluid experiences to a Web application.

Flex for Java developers

General benefits might be enough to attract you to Flex, but there are others that are mostly or entirely aimed at Java developers.

  • Print
  • Feedback

Resources

Download the Flex SDK, including the command-line compiler and debugger. A single zip file contains the Flex SDK for multiple platforms.

More from JavaWorld