BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Integrate Flex with Spring Framework

Integrate Flex with Spring Framework

This item in japanese

As rich-Internet application (RIA) technologies mature, it is becoming increasingly important to integrate RIA, such as Adobe Flex applications, with robust server-side services. One of Java developers' favorite server-side frameworks, Spring, could play an important role in this process.

Marco Casario of RIAvolutionize the Web explains why he recommends BlazeDS to Spring integrate the Flex enterprise system, saying, “Spring is an open-source framework that helps make the developer's life easier. Using standard JEE approach, you'll tend to write a lot of code that is not useful or redundant or spend time implementing J2EE design patterns that are workarounds for technology limitations rather than real solutions. By cutting out these processes, Spring can save you a lot of time.”

Christophe Coenraets provides the rationale for integrating Flex with Spring:

The whole idea behind Spring Inversion of Control (IoC) is to let the container instantiate components (and inject their dependencies). By default, however, components accessed remotely by a Flex client are instantiated by Flex destinations at the server-side. The key to the Flex/Spring integration is, therefore, to configure the Flex destinations to let the Spring container take care of instantiating Spring beans. The Flex data services support the concept of factory to enable this type of custom component instantiation. The role of a factory is simply to provide ready-to-use instances of components to a Flex destination, instead of letting the Flex destination instantiate these components itself.

With respect to the integration of Flex, Spring, IBATIS and Cairngorm, Chris Giametta remarks:

I believe in creating a consistent, modular, and repeatable architecture. The architecture must be sufficient to support small applications as well as extremely robust enterprise applications. A key to project success is creating an architecture that new developers can rapidly integrate themselves into and begin to be productive on day one. I feel that Flex combined with Spring, iBATIS, and Cairngorm help me to quickly produce a patterned- based, repeatable architecture.

Sébastien Arbogast went to the effort of creating a blog series to demonstrate how to build a full stack of Flex, BlazeDS and Spring integration.

Arbogast's stack, from the bottom up, includes JBoss as the application server, MySQL as the data storage, Hibernate to help data access, Spring to build the business layer, BlazeDS as the remoting service and Flexe-genial for building rich client. The system was built using Maven with flex-compiler-mojo plug-in.

Arbogast says, “This project setup certainly requires a bit of work, but—setting aside a small issue with configuration file duplication that should be fixed soon—it's pretty clean, and flex-compiler-mojo works really great.”

 

Rate this Article

Adoption
Style

BT