Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Two different HTTPService classes in Flex

Why are there two different HTTPService classes in Flex? this and this

And the second one inherits the first one. Why couldn't there be a single class combining the two?

like image 261
simplfuzz Avatar asked Jun 02 '09 18:06

simplfuzz


3 Answers

One of the objects (the first link you posted) is the HTTPService Object itself.

The second is the object that wraps the HTTPService object and gives it the additional functionality for the <mxml /> tag.

The two probably weren't combined because you don't necessarily need the implementation of the IMXMLObject and IMXMLSupport interfaces every time you need an HTTService object.

like image 105
Justin Niessner Avatar answered Oct 25 '22 02:10

Justin Niessner


mx.rpc.http.mxml.HTTPService can also handle concurrency while the other can't.

Edit:

Although in the online documentation I see concurrency as a property of both, several sources say thats not true(and my tests didn't work when I first tried using it). Also the concurrency package is only imported into the mxml.HTTPService, not the base rpc class.

Bug Comment Mederator comment on the docs page

like image 2
ryanday Avatar answered Oct 25 '22 03:10

ryanday


There appear to be more error handling features in the URLLoader class. Using MXML to create your HTTPService is not a big difference though.

// ActionScript Style
private function myService():void {
   var service:HTTPService = new HTTPService();
...service.parameters = value;...
   service.send();
}

or

< !-- MXML Style -- >
< mx:HTTPService >
...< parameters >...
< /mx:HTTPService >
like image 1
Dylan Avatar answered Oct 25 '22 04:10

Dylan