Flash Builder 4 makes a new marriage proposal between Flex and Java!
Data Centric Rapid Application Development one of the star-strickers in the Flash Builder 09 BETA league ensures seemless connectivity between Flex client and Java back-end. Said so, it promises literally “ZERO” Flex code to build a Rich Internet Application.It also provides kick-ass support for client-side Data Management and Paging.
Let us build a sample Inventory application which displays all the mobile phones available in a mall.
a) Downloadand install Flash Builder 4 BETA from http://labs.adobe.com/technologies/flashbuilder4/
b) Download the latest BlazeDS release build from http://opensource.adobe.com/wiki/display/blazeds/Downloads
FYI, BlazeDS is the server-based Java remoting and web messaging technology that enables developers to easily connect to back-end distributed data and push data in real-time to Adobe® Flex™ and Adobe AIR™ applications for more responsive rich Internet application (RIA) experiences. In short, a bunch of libraries to connect ColdFusion or Java back-ends to Flex.
c)Basic knowledge in Java Programming.
d)ZERO knowledge in Flex Programming 😦
BlazeDS comes bundled with Tomcat, but one may also deploy it on other servers like Apache,JBOSS etc.In this post i would assume the BlazeDS sits on in-built tomcat.
a) Go to tomcat\webapps\blazeds\WEB-INF and uncomment the servlet definition and mapping for “RDSDispatchServlet” and set the <param-value> as ‘false’.
b) Kindly set up your data base as mentioned here
c)Add the following class files from Files
and place it under tomcat\webapps\blazeds\WEB-INF\classes\com\random.
d)Open remote-config.xml from tomcat\webapps\blazeds\WEB-INF\flex and add the following mapping:
<properties> <source>com.random.Inventory</source> </properties>
e) Add the mysql jdbc jar file “mysql-connector-java-5.1.7-bin” to tomcat\webapps\blazeds\WEB-INF\lib.
Your BlazeDS set-up is now complete, GOTO tomcat\bin and start the server.
Here are the step-by-step instructions to achieve the workflow:
a) Launch Flash Builder and create a Flex-BlazeDS project as shown in the image below:
Click NEXT from “Project Creation” wizard and set the
server configuration based on the BlazeDS installation directory,click “Validate Configuration” and FINISH.
b) Goto Data->Connect to BlazeDS..
c) An authentication dialog will pop-up, select “No password” check-box and click OK
d)In the Import BlazeDS/LCDS service wizard, enter the service name as “MyDestination”, select the destination and FINISH.
e) Click on J2EEProject.mxml and switch to the design view.
f) Go to Components->Data Controls, select Data Grid and drag-drop onto the design view
g) Now drag-drop getAllItems functions onto the Data Grid. The preview is shown above.
h)Context click on project and select ‘Run Application’ . All the values in the data base gets populated in the data grid launched in the browser.
Similarly all the CRUD operations can be performed including client-side Data Management and Paging without any Flex code.
Wanna know what’s the magic ?? Hoping to get back soon with the MAYA “behind the scenes” 🙂
Now how many of us agree that Java Developers can tie KNOT with Flex for their RIA development ???