Ben, I don't think ObjectTranslator is the way to go here.
 
I would develop a simple QName to Class map. If an element had complex
content and its QName was known to map to a Class, I'd create a new
instance of that class. I would then ensure that all of my Classes
implemented an interface that guaranteed that they could populate
themselves from XML. This is important as it avoids expensive generic
type reflection when determining how to set properties on an instance of
a Class.  (For an expensive example, consider properties that are typed
as Array or are very losely typed but could potentially hold an Array!).
 
For unknown types you could just create a plain old Object and that is
much easier to handle generic XML -> AS conversion as all properties are
of type Object.
 
SOAP is just not a fast way of transmitting huge amounts of data as
generic deserialization based on XML Schemas will never be as fast as
purposed deserialization.

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of ben.clinkinbeard
Sent: Tuesday, February 27, 2007 2:43 PM
To: [email protected]
Subject: [flexcoders] Flex choking while converting less than 2 MB of
data



I am calling a web service that sometimes returns up to 1.9 MB of SOAP
formatted data. I have left the resultFormat set to object, and it
seems to handle the initial parsing into anonymous objects without
much trouble. However, when I attempt to convert this structure into
class instances the player chokes and usually ends up freezing the
browser.

The object structure consists of one main Batch object instance, which
contains 2000 BatchDocument instances, which in turn each contain a
single ClientInfo object instance and up to four Plan object
instances. This doesn't seem like a structure that Flex should fail so
miserably with as the performance everywhere else has been pretty
impressive. I have attempted this using Darron Schall's
ObjectTranslator class
(http://www.darronschall.com/weblog/archives/000247.cfm
<http://www.darronschall.com/weblog/archives/000247.cfm> ) as well as
simply passing the anonymous objects to my class constructors. Both
result in a completely unusable application.

Any help is greatly appreciated.

Ben



 

Reply via email to