BT
x Your opinion matters! Please fill in the InfoQ Survey about your reading habits!

Article: Spring BlazeDS Integration - What it Is and What Does it Change?

by Dave West on May 14, 2009 |

This article by Ryan Knight explores how the Spring BlazeDS Integration project changes the way applications are wired and how to convert an existing Spring project to use this new integration. Features of and benefits for developers, arising from this project, are also discussed.

Adobe and Spring first announced the Spring BlazeDS Integration project late last year, with the goal:

to allow the Spring development model to be used for creating Rich Internet Applications (RIA's) with Adobe Flex, BlazeDS, Spring and Java. This would allow Spring managed services to be exposed through BlazeDS without the overhead of extra configuration files. The primary benefit is that it brings Spring ease of use to creating applications with Flex, BlazeDS and Java.

 

Following an introduction on developing rich internet applications the Spring way, the article shows how to set up the server and client sides of a Spring BlazeDS Integration project and then how to secure the remote services on both the server and client side of the application.

Read Spring BlazeDS Integration: What it Is and What Does it Change? for information and example code.

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

What about 'good old' SpringFactory & BlazeDS? by Jan Vissers

Hi,

I have the same question to you as I had for Christophe Coenraets on his article over here (ria.dzone.com/articles/introduction-spring-blaz...) at DZone. So basically - what does Spring/BlazeDS integration bring to the table extra compared to BlazeDS SpringFactory?

-J.

Re: What about 'good old' SpringFactory & BlazeDS? by Jeremy Grelle

The SpringFactory is fairly limited in its approach in that it relies on a 'dependency lookup' mechanism instead of making full use of Spring's DI facilities. This requires that any bean looked up and exposed by the SpringFactory must be available from a root WebApplicationContext, which in turn restricts your options for achieving good modularity in a complex application. Running the BlazeDS MessageBroker as a Spring-managed bean eliminates such restrictions and allows us to integrate with the AMF message processing pipeline on a deeper level. For example, the securing of BlazeDS Endpoints using Spring Security while providing proper handling and translation of results into AMF messages that have enough information to be reasoned upon in a useful way on the client would not be easy to achieve otherwise. In addition, we have been able to completely eliminate the need for writing and maintaining the BlazeDS-specific remoting-config.xml and messaging-config.xml files, and we have connected BlazeDS MessageDestinations to Spring JMS and Spring Integration facilities in ways that would not have been possible using the factory mechanism.

It must be pointed out that although this article has done an excellent job of illustrating the basic approach and architecture of Spring BlazeDS Integration, it looks to have been written using an early pre-M2 snapshot of the project's SVN trunk and is already rather outdated by the release last week of Spring BlazeDS Integration RC1. The configuration details (including both XML namespace support and annotation support) are significantly simpler than what is illustrated here, and the security and messaging features are now fully implemented. I would highly encourage anyone interested to check out Christophe Coenraets' latest version of the testdrive samples to get a full grasp of how much simpler things are with RC1. Look for these samples to be fully integrated into the project distribution and runnable out-of-the-box via Eclipse WTP in the upcoming RC2.

Jeremy Grelle
Spring BlazeDS Integration Lead

Testing by Kenny MacLeod

My big concern with using Blaze on the server is with testing. Specifically, how to write tests which invoke the blaze endpoints and verify they're behaving correctly, when it involves a proprietery binary protocol.

For this reason, I'm more inclined to stick with simple XML-over-HTTP endpoints and have my flex application talk to that instead. It's not as performant as Blaze, but and it's testable.

Re: What about 'good old' SpringFactory & BlazeDS? by pankaj pardasani

How Blazeds serializes the lazy beans / pojo's returned by hibernate under Spring environment? I guess blazeds still doesnt supports HibernateProxy and would fetch the whole object graph while doing the serialization for Flex/other RIA layer.

Re: What about 'good old' SpringFactory & BlazeDS? by Jeremy Grelle

That's correct, BlazeDS doesn't have any out-of-the-box support for handling Hibernate lazy associations. But there are a number of open source adapters that can be plugged in to handle this, such as dpHibernate and Gilead.

Re: Testing by Adelino Rodrigues

I agree that using XML messages over http makes it simple to test and develop the Flex code independently from the backend.

Achieving the same degree of decoupling with Remote Object calls is harder... but achievable. We managed to get this degree of decoupling by using:

  • Spring for Action Script (Prana framework) for being able to configure the Remote Object implementation from the flex side

  • By providing mock implementations for all our Remote Object implementations


This way our Flex developers can work autonomously from FlexBuilder, do debugging, etc without having to connect to a backend.

Re: What about 'good old' SpringFactory & BlazeDS? by Wim Deblauwe

We just switched from SpringFactory to the Spring-BlazeDS integration and configuration is significantly simpler. We also had a special layer to define what methods in our server can be called by the Flex client, but this is now no longer needed as this can be configured via Spring BlazeDS.

BlazeDs vs GraniteDS by Kenny MacLeod

How does BlazeDS compare with GraniteDS? The latter seems to be an open-source reimplementation of much that Blaze does, with many bells and whistles on top, such as runtime generation of AS3 and MXML from a web container.

Sounds too good be true, though.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

8 Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT