Arp 3 Preview Release

Arp PizzaService sample application in Flex 2 and ActionScript 3

I've committed the first working version of Arp with AS3 and Flex 2 support into the Arp SVN repository.

You can check out just the AS3 version of the framework from: http://svn1.cvsdude.com/osflash/arp/trunk/as3/

See just the code for the Flex 2 version of the PizzaService sample application here: http://svn1.cvsdude.com/osflash/arp/trunk/samples/PizzaService/client/flex2/

(You can use Import... -> Existing Projects into Workspace to import both of those into your Flex Builder 2 workspace.)

The current Flex 2 version of the PizzaService sample application is a port of the Flex 1.5 version. While migrating it, I found that there wasn't support in Flex 2 for migrating applications that use AMF0 remoting (i.e., those built in Flex 1.5 and lower that use Flash Remoting). Instead of using the tag, and complicating the migration process, I decided first to create a migration layer to make it easier to port Flex 1.5 Arp applications to Flex 2.

The PizzaService application in Flex 1.5 defines a service in the ServiceLocator as shown below:

var pizzaService:Service = new Service ( gatewayURL, null, "PizzaService", null, null );
In Flex 2, the call is slightly different and you use the new AMF0Service class in Arp 3:
var pizzaService:AMF0Service = new AMF0Service ( gatewayURL, "PizzaService", null );
Similarly, in Flex 1.5 you call a server-side method through Remoting as shown below:
var pizzaService:AMF0Service = ServiceLocator.getInstance().getService ( "pizzaService" );
var pendingCall:AMF0PendingCall = pizzaService.order( orderVO );
pendingCall.responder = new AMF0RelayResponder(this, "onResult", "onStatus");

To do the same thing in Flex 2 is as easy as replacing the Service, PendingCall and RelayResponder classes with the new migration classes provided in Arp 3 -- AMF0Service, AMF0PendingCall and AMF0RelayResponder -- as shown below:

var pizzaService:AMF0Service = ServiceLocator.getInstance().getService ( "pizzaService" );
var pendingCall:AMF0PendingCall = pizzaService.order( orderVO );
pendingCall.responder = new AMF0RelayResponder(this, "onResult", "onStatus");

I want to thank Mike Potter for his RemotingConnection class, which extends NetConnection and makes AMF0 work in ActionScript 3. Arp 3 makes use of Mike's class.

This is a preview release of AS3 and Flex 2 support in Arp. As such, I'm releasing it without having tested it extensively. Please feel free to report issues in the comments of this post or to contact me directly with bug reports, etc. I am planning on creating another version of the PizzaService application that makes extensive use of Flex 2 features such as data binding, states, the tag, etc. (Consider this version the migration version.)

Known issues:

Comments