Chapter Using BlazeDS Blaze Data Services (BlazeDS) is an open-source data-exchange technology that connects Flex clients to server-side resources. For connecting Flex to Java, BlazeDS is an open source technology for An ideal example of this is the Borders book store chain, which. Professional BlazeDS by Shashank Tiwari, , available at Book Depository with free delivery worldwide.
|Published (Last):||4 April 2012|
|PDF File Size:||1.35 Mb|
|ePub File Size:||6.83 Mb|
|Price:||Free* [*Free Regsitration Required]|
Apr 27, 10 min read.
It talks about why Flex with BlazeDS is one of the best choices for developing rich Internet applications RIAs —from highly interactive websites to enterprise applications with Java back ends. Most importantly, it shows the high return on investment ROI that this combination provides, both for developers and for enterprises. Through the example, I explain the different ways you can use BlazeDS, either with your existing Lbazeds applications or with new Java applications. The core Flex software development kit SDK is an open source framework used for building and maintaining RIAs that look and feel the same across different browsers and operating systems.
Flex is released under the Mozilla Public License. Compiled Flex applications run in the proprietary Adobe Flash platform. It runs on Java application servers as a blazede, allowing you to use it in any standard Java web application.
Flex has a very active community, with a lot of community-contributed projects. For example, the FlexLib project on Google Code has contributed a large amount of open source user interface UI components. The Swiz and Mate projects have contribute a framework to help handle events. According to James Ward, a Flex evangelist for Adobe, there is still a large need for senior Flex developers. Learning Blazeeds gives you marketable skills that will put you ahead of the competition.
In general, developing enterprise web applications blazed been notoriously difficult. Flex and BlazeDS provide not only higher-powered tools but are also easier to develop with.
The increase in developer productivity allows organizations to get to market more quickly. Flex and Flash also create a more engaging user experience, which can increase traffic and conversion rates. An ideal example of this is the Borders book store chain, which recently introduced a new website with a “Magic Shelf.
Borders found that this greatly increased conversion rates: Most languages add support for building UIs as an afterthought. This was particularly true for Java with Swing. As a result, simple things in Swing—like wiring data—can be painful and require using Swing-specific data models.
The largest problem with Swing is that you have to dig very deep into the application programming interface API to be productive. Flex is the exact opposite: It was designed from the ground up for building web UIs. Data binding, event handling, component layout, and other, common UI development techniques are built into the language, which allows you to be productive even when you know very little about the language. You can develop with the existing tools used to develop Java.
Flex provides a stateful environment in which data is loaded from the client. The programming model is more like developing a desktop client than Hypertext Markup Language HTML programming, which makes the programming model feel familiar to anyone who has done Java Swing programming. This combination makes programming Flex similar to programming with Java, because you can use the familiar object-oriented concepts.
An ideal way to set up your development environment is to have the Flex application built right in your web deployment directory. That way, you do not need to re-deploy your application after every build: A simple browser refresh reflects the latest changes. Developing with Flex and BlazeDS is fairly productive as a result. For this article, I used the binary distribution, which comes as a web archive WARto show how you can deploy to any application server. Otherwise, you can extract the Java archive JAR files and use them in your project.
This example uses BlazeDS with an existing project—a simple soda dispenser. You just need to add the JAR files to your project, then you can use BlazeDS from within the application, which allows you to deploy it anywhere you can deploy the application. For the soda example, assume that you want to expose your existing soda service so that remote Flex applications can connect to it.
The basic steps to set up BlazeDS with an existing application are:. After you set up BlazeDS, you need to add your soda service to the BlazeDS remoting configuration file, which allows the soda service to be called from a Flex client. You make this addition by defining a destination and one or more channels to transport the data. The basic AMF Channel is defined in the services. Use this definition to identify your destination in remoting-config. By defining endpoints in the remoting configuration file, you can call any basic Java service from a Flex client.
To pass your Java data model to your Flex client, define a mapping between the two in your ActionScript class:. The Flex client in the sample shows how to call this Java service.
The call returns a SodaModelfilled with your order:. Flex returns your results in the generic result variable, which you map into your SodaModel. I won’t go into the details here, but one tip is to specify services-config. If not, your Flex client will not be able to find the Java services. In the same manner, you can pass an object from the client back to the server.
For example, you blazsds pass the empty soda model back to the client. Suppose you decide that you want to add special logging anytime the soda service is called. You can extend the standard Java adaptor to add logging. In this method, you can see the incoming operation and the destination for the call. You can use this simple hook for other things, as well—for example, timing how long calls to the server are taking.
You can make this call in several different ways, such as through the Browser Manager and flashVars. For example, suppose you wanted to pass your user name and the type of soda you want to order in from your HTML page.
Then, in booi Flex application, you can read these variables by getting the application parameters:. An open standard, AMF is extremely fast. James Ward put together a sample that shows a comparison with other remoting solutions.
Being able to call BlazeDS this way is extremely useful for unit testing and load testing. Adobe and Spring have teamed up to bring closer integration blazesd the two projects, and the initial release of the Spring—BlazeDS integration shows a blzeds of promise.
Where to get Flex – Java DS (Blaze) training material? – Stack Overflow
By allowing a Spring Bean to become a remote service, duplicate configuration files will be eliminated. For more information, visit the project’s home page. With BlazeDS being open source and based in Java, it is an ideal choice for new and existing Java server projects. Java developers new to Flex and BlazeDS will find the development process highly productive and easy to learn. Flex with BlazeDS is also an ideal choice for large-scale Java enterprise applications.
In a previous project, my team wrote an application that contained over 50 different screens and would regularly transfer several thousand rows of data between the server and client. This type of application would have been nearly impossible using traditional Ajax technologies.
With Flex and BlazeDS, we where able to release an initial version in under a year. See what this dynamic duo can do for your application-development projects. You should have some basic background in these technologies. Join a community of oversenior developers. You need to Register an InfoQ account or Login or login to post comments. But there’s so much more behind being registered. Your message is awaiting moderation.
Agile Enterprise Application Development with Flex by Tony Hillerson
Thank you for participating in the discussion. I don’t think people should learn Flex because it works with Spring, that is quite biased statement. Not everybody love Spring! Is the writer a Springsource marketing? From the Java community audience perspective, Spring project-level support is a valid argument for promoting the use of a technology.
You don’t have to love Spring to appreciate its importance and ubiquity. I further doubt the Spring brand needs advertising on this forum: The Spring support will be the most important argument for projects that have a Spring backend today and will port the frontend to Flex tomorrow without re-implementing the business logic again.
Spring support additionally allows to have a mixed client environment. That’s pretty cool even today. So, you can add client functionality that delivers a better user experience bllazeds the need to skip your existing markup-based client stuff JSF, You can have separate client balzeds or you add small Flex components to your existing client environment for a smoother migration. And the user experience is really fantastic.
13 Reasons for Java Programmers to Learn Flex and BlazeDS
And this is coming from someone who, in spite of this text, booj Adobe and it’s ethics. Surely you have to factor the probablility of this happening bkazeds your technology decisions?