The “Spring ActionScript” Framework – Part 2: Autowiring

In the first part of this series, we looked at how the “Spring ActionScript” framework can help you externalize the configuration and the wiring of your components, and how you can easily obtain configured objects using applicationContext.getObject().

In this second part, we will discuss how you can make these objects available to the views of your application without tightly coupling these views to the framework, and without passing references around through potentially many levels of view containment.

We will build the “Spring ActionScript” version of the InSync contact management application I often use in this blog to explore new technologies. The application has two views: MainView and ContactForm. Both need a reference to a contact RemoteObject to work.

NOTE: This example is intentionally kept simple. In a more partitioned application, you may want to pass a more abstract controller around as opposed to a specific RemoteObject. We will use this approach in part 3.

The views could use applicationContext.getObject() to access their dependencies (in this case the contact RemoteObject), but this approach has a number of problems:

  1. With a dependency on applicationContext, the views would be tightly coupled to the framework.
  2. We would still need to pass a reference to the applicationContext object to the views. This is often solved using the singleton approach which has its own set of problems.

So, instead of the views instantiating or looking up their dependencies, a better approach would be to “inject” these dependencies into the views.

Unlike Swiz, “Spring ActionScript” doesn’t currently have built-in support for an [Autowire] annotation, but Christophe Herreman seems to imply that this feature is coming, and in the meantime, he provides some sample code to support “Spring ActionScript”-powered autowiring in your application. Using this custom code, the inSync application looks like this:

Read the rest of this entry »

  • Digg
  • del.icio.us
  • Facebook
  • Google
  • description
  • LinkedIn
  • Pownce
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis

Spring/BlazeDS Integration Test Drive: M2 Update Available

UPDATE: This version of the Test Drive is now obsolete. I posted a new version of the Test Drive for the RC1 build of the Spring / BlazeDS integration project here.

I updated my Test Drive for the M2 build of the Spring / BlazeDS integration project.

The Test Drive now includes a sample demonstrating the integration with Spring Security (the key new feature in M2). The Spring configuration file has also been updated to use the new simplified XML-namespace-based configuration.

Installation Instructions:

  1. Download the Spring / Flex TestDrive here: http://coenraets.org/downloads/spring-flex-testdrive-M2.zip
  2. Unzip it in your root directory
  3. Navigate to /spring-flex-testdrive/tomcat/bin and start Tomcat (for instance: catalina run)
  4. Open a browser and access http://localhost:8080
  5. Follow the instructions

As always, I’d love to hear your feedback and your ideas to improve this Test Drive.

Christophe

  • Digg
  • del.icio.us
  • Facebook
  • Google
  • description
  • LinkedIn
  • Pownce
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis

The “Spring ActionScript” Framework – Part 1: The Basics

The “Spring ActionScript” framework (formerly known as Prana, and brainchild of Christophe Herreman) is being built as the ActionScript version of the Spring IoC framework hugely popular in the Java world. It is also part of a growing number of Flex frameworks that revolve around the Dependency Injection approach (the list also includes Swiz and Mate).

I recently spent some time exploring “Spring ActionScript”. There aren’t a lot of resources available yet, so I figured I would contribute my own exploration.

Note: Also, to avoid confusion, this project is independent from the Spring/BlazeDS integration project I have been writing about a lot lately. These two projects could however complement each other nicely.

In this first post, I’ll cover the basics… Imagine you have an application that uses RemoteObject to access the back-end of your application. Unless your application is made of only a couple of components and will forever communicate with the same server, there are two issues you’ll have to deal with early on:

  1. How to externalize the service configuration (channels, endpoints, etc) from your code
  2. How to provide the different components of your application with a reference to that service

Read the rest of this entry »

  • Digg
  • del.icio.us
  • Facebook
  • Google
  • description
  • LinkedIn
  • Pownce
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis

Tampa User Group: Flex 4, Catalyst, SpringSource and more…

The Tampa Flash, Flex and AIR Developers Group has a special meeting next Wednesday (March 4th) with an impressive agenda (including Flex 4, AIR 1.5, Catalyst, CF Next, Spring/BlazeDS presentations), and an equally impressive speaker line up: Ben Forta, Greg Wilson, Kevin Hoyt.

Jeremy Grelle, SpringSource Engineering lead will also present the recently released Spring / BlazeDS integration.

More informatiom about this event here.

  • Digg
  • del.icio.us
  • Facebook
  • Google
  • description
  • LinkedIn
  • Pownce
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis

ILog Elixir 2 Released: Calendar Component, Heat Maps, and More…

ILOG has released V2 of their Elixir Flex components. The list of new components available in version 2 includes: Calendar, Gantt task charts, heatmaps, and OLAP/pivot charts. All the version 1 components have been improved as well.

Check out the live demos here.

Additional product information is available here.

I recently posted a sample Adobe AIR application named Quicklook that shows how to use the new ILog Calendar component and persist the calendar data in a local SQLite database. This application was built with the latest beta version of ILog Elixir 2, and works without modification with the GA version. Check it out here.

  • Digg
  • del.icio.us
  • Facebook
  • Google
  • description
  • LinkedIn
  • Pownce
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis

Spring / BlazeDS Integration on Adobe TV

In this new Adobe TV episode, I demonstrate how to build Flex applications that connect to a Spring back-end using the new Spring / BlazeDS Integration project.

If you are interested in this integration, make sure you check out the Spring / BlazeDS Integration page on the SpringSource web site and the new Spring / BlazeDS Integration Test Drive.

  • Digg
  • del.icio.us
  • Facebook
  • Google
  • description
  • LinkedIn
  • Pownce
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis

My New Adobe TV Episode: Model-Driven Development in Flex Builder 4 and LCDS “Next”

Using Adobe Flex Builder 4 and LCDS “Next”, you will be able to build data-driven applications using a Model-Driven Development approach. In this Adobe TV episode, I give a sneak peek of this new feature.

  • Digg
  • del.icio.us
  • Facebook
  • Google
  • description
  • LinkedIn
  • Pownce
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis

Speaking at QCon London in March

I will be speaking at the QCon Conference in London again this year. QCon is a very high quality conference with deep technical content around Java, .NET, SOA, etc. I highly recommend it if you have the opportunity. I’m particularly excited about my presentation this year: In addition to “sneak peeking” some new development in the Flex world, I will be focusing on the Spring / Flex integration recently announced by SpringSource and Adobe. I hope to see you there.

  • Digg
  • del.icio.us
  • Facebook
  • Google
  • description
  • LinkedIn
  • Pownce
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis

Tour of California 2009 with Lance Armstrong, Flex and LiveCycle Data Services

The 2009 edition of the Tour of California starts tomorrow. For the third consecutive year, you will be able to follow the race live using the Adobe Tour Tracker.

Read the press release here.

I wrote about the initial implementation of the LCDS backend back in 2007. This write-up is now a little dated but still provides a high level overview of how LCDS is being used.

Start the Adobe Tour Tracker.

  • Digg
  • del.icio.us
  • Facebook
  • Google
  • description
  • LinkedIn
  • Pownce
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis

Sample application using the Swiz Framework and BlazeDS

There have been a lot of discussions around Flex Frameworks lately. Tony Hillerson has an interesting series here: 1 2 3 4 5 6

A relative newcomer on the list is Swiz, the work of Chris Scott. I figured I would give it a try, and create a Swiz version of the inSync application that I often use to try out and demonstrate different features and techniques in Flex and Adobe AIR. This is not an endorsement of Swiz over other frameworks. I simply wanted to share the sample application I built as part of my own research as a (neutral like a Swiss) Evangelist.

View the source code.

Read the rest of this entry »

  • Digg
  • del.icio.us
  • Facebook
  • Google
  • description
  • LinkedIn
  • Pownce
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis