My Books

  • Follow me on Twitter
My Photo

Subscribe my blog

  • Get this widget from Widgetbox
  • Add to Google
  • RSS FEEDS
  • Enter your Email here to subscribe :



    Powered by FeedBlitz

Blog Widget by LinkWithin

« Download the free Adobe AIR 1 for JavaScript Developer pocket guide | Main | Exctract and learn from the Flex 3 data visualization source code (the charting controls, the AdvancedDataGrid classes, the OLAP classes, and the automation classes) »

Why you should consider Spring in your Flex, BlazeDS and Livecycle DS scenarios

Today during a presentation about the use of Flex in enterprise scenarios, while I was illustrating the benefits of using the factory mechanism of BlazeDS to integrate it with Spring, a developer asked me why use Spring for Flex development (I guess he does not come from the Java world).
I think that the answer could be obvious to most of you but I want to share my thoughts with you about that topic. Feedbacks and opinions are appreciated :)

Spring is an open source framework that helps a lot the developers' life to make it easier.There some factors you have to consider when you develop a Java application. In fact using the standard JEE approach you'll tend to write a lot of unuseful and repeatedly code or implementing J2EE design patterns that are workarounds for technology limitations rather than real solutions to a problem. This is where Spring can save you a lot of time.
Spring uses the Inversion of Control (IoC) pattern that runs in any environment.

From  Wikipedia: The Inversion of control - also known as IoC - is a concept, and an associated set of programming techniques, in which the control flow is inverted compared to the traditional interaction model expressed in imperative style by a series of procedure calls. Thus, instead of the programmer specifying, by the means of function calls, a series of events to happen during the lifetime of a programme, they would rather register desired responses to particular happenings, and then let some external entities take over the control over the precise order and set of events to happen.

The container used by Spring is very lightweight and reduces the  startup time by instantiating components dependencies when it creates them.
Moving out the configuration code to provide dependencies we use Spring to assemble and manage the application components (Spring beans).

Spring Beans are Java objects so in order to access these Spring objects from Flex you have to use BlazeDS or Livecycle Data Services and then configure the destination to point at.
The essence of Spring is in providing enterprise services to Plain Old Java Objects (POJOs).
The POJO term was coined by Josh MacKenzie, Martin Fowler, and  Rebbecca Parsons to intend a Java object that doesn't implement any special interfaces.

Then using the SpringFactory  you can use Flex destinations with dependency-injected instances of Spring objects.
Having dependency injection containers allows you to configure the application consistently in one place. 

The SpringFactory was developed by Jeff  Vroom (http://weblogs.macromedia.com/lin/README.txt) and is also available on Adobe Exchange.

More information on the Spring framework can be found at the Spring's homepage. And don't miss the Christophe's article on Flex and Spring

Comments

I have a set of examples that uses Spring/Hibernate with LCDS here: http://www.infoaccelerator.net/uploads/enclosures/360Flex.zip

Hi,

can you pls help me out.
I have a tomcat server with blazeds
trying to communicate with a webservice
located on a weblogic server

In my MXML client I have the

useProxy="true" and
destination="ultMLT"

In my proxy-config.xml under

WEB-INF/flex

I have teh following setup



g9uant
Arvnd_14
http://localhost:7001/WebServices/UltimateLookThruService?WSDL
http://localhost:7001/WebServices/UltimateLookThruService



The communication happens ..
But on the weblogic side the logs show that it failed as it was approached with user id as "anonymous"

I have set the "remote-username" and "remote-password" as suggested in the docs

What am I missing here.

Does this not work in Blazeds .

Any help in this matter will be greatly appreciated.

Thanks
Thiagu
(alagesan thiagarajan)

P.S: I constantly follow your blogs.. They are very helpful.

Another approach to the IoC pattern: the Prana Framework:
http://www.pranaframework.org/

Have you given a look at Grails + Flex Plugin?

http://grails.org/Flex+Plugin

Seems to me that it connects Flex with Spring (Grails = Groovy (Java) + Hibernate + Spring) in a couple of simple steps.
Right now, all it needs is a good scaffolding Flex generation.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Pistach.io

Speaker at

WebDeveloper's Journal Author

  • My favourite Flash Lite 3 mobile phone
  • Web Developer's & Designer's Journal by Sys Con Media
  • Web Developer's & Designer's Journal Blogger
    Web Developer's & Designer's Journal by Sys Con Media
  • FullAsGoog Aggregator
  • Macromedia WebLogs Aggregator

June 2009

Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30