views:

21

answers:

1

I am relatively new to the Mate framework, but so far really like what I see. My application makes a lot of use of the <RemoteObjectInvoker> tag to call my BlazeDS/Java service methods on the back-end.

However, it is bothering me that I must enter the string name of hundreds of remote methods into my EventMap because errors are not discovered until runtime. It also bothers me that problems with the structure of the arguments are not discovered until the request hits the server. Furthermore, all of this makes it harder (not impossible) to provide a mock data services layer.

In order to solve these problems, I have created an ActionScript3 interface for each remote service destination that has methods. These methods wrap the "getOperation" and "send" calls. Each method returns an Async token, just like the "send" call does.

However, I am struggling for a way to invoke these strongly typed service methods from my Event map. I am looking for:

1) RemoteObjectInvoker to have the method attribute take an ActionScript function/method instead of a string remote method name. And then to call that method to get the async token rather than use the String name in getOperation.

2) Barring #1 -- Is there some kind of tag like MethodInvoker, but that can handle Async tokens and result/fail handlers?

3) Barring #2 -- I am thinking I'll need to create a Mate extension. Perhaps a new tag called "AsyncMethodInvoker".

Any idea as to the best course of action? I'll dump Mate if I have to, but I really want to keep it!

A: 

Found it in an available, but undocumented class in the API. It is called the delegate invoker and can be found here:

http://mate.asfusion.com/api_docs/com/asfusion/mate/actions/builders/DelegateInvoker.html

There is also already a tag called AyncMethodInvoker as well, but the DelegateInvoker seems more appropriate for remote service calls.

HDave