>  - When serializing an object to the SharedObject, is the whole object
>  hierarchy traversed? For example, if I have a model that stores a
>  ParentObject which has an array of ChildObjects, and I stick the
>  ParentObject in the SharedObject, when I retrieve it will I get back
>  the ParentObject with a complete array of ChildObjects?

So, I ran some tests with writing objects to ByteArrays. It appears as
though all referenced objects are serialized as well, as deep as
necessary I assume. It also looks like it does the "right" thing and
only serializes any specific instance once, and when they're
reconstituted there's only one instance with potentially many inbound
references. Very cool.

Of course, unless there's something I'm missing, I'll have to manually
handle the case where I have two separately serialized object
hierarchies that had overlap... when they're reconstituted, there's no
linkage between the two hierarchies and the overlaps become duplicated
(and thus, no longer centralized/shared) data.

That scenario leads me to think that I may need to override the
default serialization to include an additional serialization of a
UUID, and then when the object is reconstituted register the UUID so
that if the object is reconstituted from another hierarchy it can be
located and references wired appropriately. Unless, of course, AS3
already does this for me (I wouldn't be surprised!). Any thoughts?

And for those with some AMF knowledge, what's the best way to store
AMF data on the server-side? For a lot of my data (that I don't need
indexed by the SQL database) I'd just assume not convert it to a PHP
object, translate it to its own row in the database, then reverse the
process. Do I just stick the AMF data in a BLOB (MySQL is my brand of
server if that matters)? Would I be better off dumping the blob to
disk and just storing its path in SQL? (Note: I realize this question
is veering a bit into DB admin territory -- we all wear multiple
hats!)

Thanks for the insights,

Troy.


Troy.

Reply via email to