Re: [Flashcoders] Keeping XML Objects
I started to come to the same conclusion while writing the previous post -- why use XML if you don't have to. It would probably be better just to create a serialized object directly from the database and deserialize that in Flash. XML's always been the standard, and frankly when starting an app my mind goes there first. thanks for the advice. On 7/5/07, Ron Wheeler <[EMAIL PROTECTED]> wrote: For performance, if you have to parse it once you might as well convert it to objects . I do not always follow this advice and for the most part, on a reasonably modern PC it really does not matter. You do not have to use XPath. We just parse it in ActionScript in each getter as we need the info and once you have the pattern figured out, it is pretty easy. Just make sure that you have good set of Objects even if the only property is an XML structure. You can always change the methods later if you decide to parse the XML once. If you ever want/need to change a value at runtime, you will be much happier with objects. Ron ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Keeping XML Objects
For performance, if you have to parse it once you might as well convert it to objects . I do not always follow this advice and for the most part, on a reasonably modern PC it really does not matter. You do not have to use XPath. We just parse it in ActionScript in each getter as we need the info and once you have the pattern figured out, it is pretty easy. Just make sure that you have good set of Objects even if the only property is an XML structure. You can always change the methods later if you decide to parse the XML once. If you ever want/need to change a value at runtime, you will be much happier with objects. Ron Jer Brand wrote: Question, and one I think I know the answer to: If I have a configuration XML file for an app, would it be better from a performance standpoint to keep the XML object around as my configuration object, or to pull out the data into a custom object structure (something simple, think object->array of objects)? I would think that keeping the XML Object around would require more resources -- especially if using XPath. I'm not sure how much baggage I'm carrying around with an XML object. On the flip side, it's a built-in object, and if you use XPath once, you've got the classes loaded. And it doesn't get much easier than XPath + XML for data retrieval. My thinking says, dump XPath, load in the XML save it's data and dump it when done. Or dump XML all together and use a serialized object (PHP Serializer or some such). Opinions? ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
[Flashcoders] Keeping XML Objects
Question, and one I think I know the answer to: If I have a configuration XML file for an app, would it be better from a performance standpoint to keep the XML object around as my configuration object, or to pull out the data into a custom object structure (something simple, think object->array of objects)? I would think that keeping the XML Object around would require more resources -- especially if using XPath. I'm not sure how much baggage I'm carrying around with an XML object. On the flip side, it's a built-in object, and if you use XPath once, you've got the classes loaded. And it doesn't get much easier than XPath + XML for data retrieval. My thinking says, dump XPath, load in the XML save it's data and dump it when done. Or dump XML all together and use a serialized object (PHP Serializer or some such). Opinions? ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com