Notes
Sunday April 20, 2003
PHPObject does not use AMF
Action Message Format (AMF) is the proprietory message transmission protocol implemented by Macromedia in its flash remoting technology. It is a binary message format and is modeled on the Simple Object Access Protocol (SOAP) used in web services implementations.
It is important to note that PHPObject uses the conventional client-server connection commands in Flash MX and transmits data to and fro the server in plain-text and not binary.
The PHPObject class along with its PHPObject Gateway merely makes client-server connections and data-binding betwen flash and PHP easier.
In my opinion, it is debatable whether the plain-text message format used in PHPObject will indeed be inferior to using AMF. I agree that AMF should outperform XML. But in PHPObject, structured data in Flash is serialized (made possible with SerializerClass) into a format recognizable by PHP's native function deserialize(), which means that the gateway can translate the incoming message into PHP data types with a single line of code. Likewise, when returning data from the server, the gateway serializes the object using PHP's native function serialize(), once again this can be done with a single line of code. There is no conversion between binary and text. The PHPObject Gateway also makes the return message size smaller than usual by sending back only properties that have changed (the client would already have the other unchanged properties). This makes data transfer and deserialization faster.
But having said that, potentially for larger and really complex objects, perhaps AMF will remain the better choice.
Please post any comments you may have, or share what you have experienced using both formats.
Posted by sunny at April 20, 2003 01:24 PM
|
Comments
A question by this way, does allow PHPObject to create any kind of preloader? I can't find functions like 'getBytesLoaded' or 'getBytesTotal' known from XML or loadVars-object, only the up- and download bytes after receiving result. I hope that the serializing-process allow to get byte-info like these from server side. At last I want to 'say thx' to the developers of PHPObject - a great an powerful open-source project! (-> I love it ;)) greetings Posted by: irresponder at June 18, 2003 06:04 AMYou can use myFoo.getBytesLoaded() and myFoo.getBytesTotal(), these methods are already in PHPObject (using the loadvars functions) but I found them behaving abnormally so I do not support their use. The progress is reported correctly the first time you invoke a remote method, but if you invoke the same method again, the bytes loaded will be zero throughout and then jump to bytes total when completed. I think it could be because of a caching problem. Posted by: sunny at June 18, 2003 10:04 AM
Post a comment
|
