Flex remoting code generator improvements
In my previous post I described the improvements in integration between .NET collections and ActionScript ArrayCollection class. This post describes the changes in the ActionScript3 remoting code generator in the upcoming 3.4 release of WebORB for .NET.
Concept
The idea is very simple, the management console for WebORB includes a service browser where you can see all the deployed assemblies. You can explore an assembly and see all the classes contained within. Upon selecting a class, WebORB generates ActionScript code you could use to invoke the selected class.
Code Structure
The new code structure is simple and can fit into many applications without any changes. The generated code consists of a controller (service) class, a bindable model class which aggregates the responses and optionally value object classes (they will be present if the remote class accepts or returns any complex types. The diagram below describes the code structure and how it would fit into a Flex application:

The two boxes in the middle represent the Service (FooService) and Model (FooModel) classes for a Foo class deployed on the server-side. The service class has the same methods as the remote counterpart. The View, which is an MXML application or component uses the service class to issue remote method invocations. All the RemoteObject code is encapsulated inside of the service class. When the service gets a response from the server, it updates the model object. The view can use Flex data binding to the model object and is automatically updated when the model changes.
Trying it out
Curious what the actual code looks like and care to try it out? Well, you're a download away (maybe two). Make sure to download and install the latest version of the product (3.3), then go to the WebORB nightly builds section in the interest group and download the file from 10-31-07 or later. The zip you download contains 3 files:
- weborb.dll - must go into the /bin folder of the product installation
- weborb.config - goes into the root folder of your weborb-enabled virtual directory
- flex-remoting-as3.xslt - goes into [WEBORB-PATH]\weborbassets\codegen







