1) Create a global object that can be accessed via anywhere
This is an antipattern that MVC is meant to correct. If you want a 'global object' you can just make a class with static methods and properties. You don't need a framework for that. But as soon as you do that then classes all over the app begin to depend on this object and it becomes 'the place to put things'. You end up with a Big Ball of Mud
[1]Make sure this object is only instaniated once
You don't have to implement a singleton, you have that in the Model. It's a registry. When you register a Proxy with the Model, only one instance can be stored with that name. That's why we use the NAME constant to register and retrieve Proxies. The nice thing is that using the same pattern, you can register a Proxy that you do want multiple instances of by using a unique name for each.
Post data to the API which then parses it into XML and sends it to our server
Expose a method on the proxy that takes the XML and sends it to the server. The Proxy can implement the Remote Proxy pattern.
Say you've generated some data at the UI, you dispatch an event heard by the Mediator for the component that generated the data, who handles the event by plucking the data off its view component, sends it off in a notification that triggers a Command that parses the data into XML and invokes the Proxy's method with the XML, triggering the server call.
Or if you use a SmartVO
[2], it will manage the conversion of the data between XML and typed object, so you don't have to have that parsing happen in a Command. In which case, you can simplify the above example by having the Mediator pluck the SmartVO off the view component and immediately invoke the Proxy method.
And finally, if you don't want to use a Command or a SmartVO, you can consider the typed-to-XML conversion process to be 'Domain Logic' and put it in the Proxy method. So that the Proxy takes a typed object turns it into XML and makes the call.
Handle the responses and callbacks of the API.
The Proxy makes the call and listens for the response. When it gets the response, you can send off a notification that a Command and or Mediators may act upon.
-=Cliff>
[1] Big Ball of Mud -
http://www.laputan.org/mud/mud.html#Abstract[2] See an example of a 'Smart VO' here:
http://forums.puremvc.org/index.php?topic=1293.msg5973#msg5973