What AS2.0 Remoting means for RIA Convergence

The blogosphere is awash with news of the new ActionScript 2.0 API for Flash Remoting, and the new Remoting Connector. A great deal of the reaction is “..long overdue..” however I think it’s more important that we take a step back and look at the bigger picture, to see what this really means to us as Rich Internet Application Developers. None of us that have been developing Rich Internet Applications for the last few years have really been held back by the lack of a Remoting Connector; in truth, for an enterprise-grade application, direct binding of the Flash UI to Remoting isn’t a typical architecture anyway. The drag and drop connector is more suited to single use-case “stock ticker” style applications. Furthermore, the workaround to use ActionScript 2.0 with the ActionScript 1.0 Flash Remoting wasn’t a barrier to development in the slightest. So … what’s the great news about the recent update to Flash Remoting ? It’s the API itself… Those of you that have been enjoying the simplicity with which data services can be achieved in Flex, using MXML tags such as RemoteObject (which incorporates Flash Remoting under-the-hood), WebService and HTTPService, will be familiar with the concept of creating a service (by instantiating an MXML Service tag), invoking methods on the service, capturing the pending-call object that is returned from such a service invocation, and attaching responders to the pending call, to be invoked when results or faults are returned. Unsurprisingly, the new Flash Remoting API offers a very similar approach – we now are furnished with a new Service class, which allows us to create a gateway connection, and obtain a reference to a service through which we can access the methods on that service. A new PendingCall object is provided, which is returned following a service method invocation – the PendingCall object contains a responder property to which we can attach the object which contains our result and status methods. And finally, we are provided with a RelayResponder class, which we can use to attach to our PendingCall. In “Developing Rich Clients with Macromedia Flex”, it’s no coincidence that the scheme we have recommended in Chapter 20 – Flex and J2EE Integration, using the command class, business delegate and service locator patterns, makes use of the same metaphors of service stubs, pending calls and responders. Flex does a fantastic job of hiding some of the details from us – which we further hide in our service locator. However, if you take a close look at the new Flash Remoting API, and also wrap your head around Data Services in Flex, and the issues surrounding function delegates, for instance, you’ll see for yourself how two hitherto disparate parts of the RIA Ecosystem – Flash Remoting and Flex – are beginning to converge through common APIs and common means of achieving the same tasks. Forget the Remoting Connector, and the excellent new documentation that will accompany the new Flash Remoting components. It’s the API and the ability to flip between Flex and Flash development more easily, that I’m most excited about…

Leave a Reply

Your email address will not be published. Required fields are marked *