<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=1194005000700189&amp;ev=PageView&amp;noscript=1">

From Vizuri's Experts

Web 2.0 with Java and Flex – The best of Both Worlds

Adobe flex provides a powerful User interface (UI) development platform which enables developing Web 2.0 style applications.  The ubiquitous availability of the Adobe Flash Player (the run time where Flex applications run) makes Flex application run virtually everywhere.  Java(TM) on the other hand provides a very powerful service development environment especially with the abundance of open source, freely available server components.   Therefore, a combination of Flex and Java for delivering powerful, responsive,  highly interactive Web 2.0 applications provides a potent alternative for traditional Web 2.0 development using HTML and various JavaScript frameworks.

So now we have a nice UI developed using Flex, packaged as SWF file and conveniently delived to the browser.  We also have powerful services developed using the J2EE platform and running on an Application server such as JBoss or Tomcat.  How do we connect the two so that the power of Java services can be delivered to the user through sophisticated, highly interactive User Interface developed using Flex. That is where BlazeDs comes in.  The BlaseDs is an open source communication framework which allows a Flex application running as a SWF in the browser to make remote calls to the Java services running in the Application Server.
  Out of the box, BlazeDs provides enough functionality for Flex to Java remote communication. However, using out of the box functionality becomes tedious and error-prone in a real world application where a number of services must be invoked and UI and Server part of the functionality must be developed by different people.  This tedium and susceptibility to errors can be mitigated by providing TypeSafe ActionScript remote Proxies to the Java Services. The ActionScript remote Proxies can be auto generated and compiled into the Flex application package and can be natively used by the ActionScript code in the Flex UI application in a Typesafe manner.   This process of code generation for the remote proxies can be integrated into the build process, therefore, making the process completely automated.
  We have used the architecture and the processes outlined above in a number of Web 2.0 applications and it has worked wonderfuly.  This has not only made our developers much more productive but also happier as they are not spending time chasing hard to find bugs that often crop up in loosely typed systems.

Swarn Dhaliwal, Ph.D.

Dr. Dhaliwal is an experienced SUN Certified Java Developer with a master's degree in Computer Science and more than 8 years of comprehensive Java implementation experience using a variety of J2EE technologies.