Why OOP AMF serialization?
In response to some questions and emails
The specification for AMF serialization define a type market for each data type. There are 13 types in AMF A type marker is one byte in length and describes the type of encoded data that follows. The general data type is very simple to handle but what is more inportant is when a second byte exists called the ecoding type byte. Type markers may be followed by the actual encoded type data, or if the marker
represents a single possible value (such as null) then no further information needs to be encoded. What data type you need to serialize based on the first byte of data field. Once you get this type you there. This is fine if you have all the time in the world to implement every type in the specification. However most people when they think of array they think of just one type. But there are three types of arrays defined by AMF and if you really want a complete implementation you need to handle all three. Outside of teh speficication people really think of AMF as Life Cycle Data Services. I need AMF in php usually is someone implying that they want all the functionality of LifeCycle DS in PHP. This is really where the OOp functionality comes into play. A fully imlemented AF gateway falls well short of LifeCycle. In the next serialization implementation that I am working on it has to be able to add these additional mapping tools that are more generic than class mapping your custom classes to be a part of the release. A common request is ArrayCollections. Class mapping ArrayCollections is something that you need in almost every Flex project but it really is not part of the AMF specification. In this specific case AMF would treat the incoming Data as an object type which it is. By using a more OOP implementation it is easy to add this as an object type but then also used an optimized ArrayCollection handler that is part of the core library’s without having to have everyone role there own.
Headers fall into this too. Most developers like to toss additional session specific or session instantiation specific data into the AMF header. The new aproach allows you to create your own handlers for those headers and of course support the defined amf_server_debug, Credentials, DescribeService.


Hey, man. This post happened to be very useful to me thanks for the specific AMF serialization info.