Thanks Florian. Problem is the performance actually degrades quite a bit when there are a lot of objects in memory. Instantiating a lot of objects is dog slow as well. Also, there would really be no dependency with the datasource even if we go XML (assuming this is the best option) because either way we have to write code to process/transform the incoming data, in this case it would be just code that transforms whatever format it comes in as into XML. There is also no need for events in this case as well since they are plain vanilla data objects with only public properties in it.
- boon --- On Sun, 8/3/08, florian.salihovic <[EMAIL PROTECTED]> wrote: From: florian.salihovic <[EMAIL PROTECTED]> Subject: [flexcoders] Re: Large XML /w E4X vs. serialized objects /w tree traversal To: flexcoders@yahoogroups.com Date: Sunday, August 3, 2008, 12:53 AM I would choose the class hierachy approach. Write your own classes for relationships, people etc. The pros of this approach: * You do not depend on a datasource: it does not matter where the data comes from ((different) XML sources, remoting [,...]). * You have strong typed objects and you can embed your own events and errors. This means (unit-) testing becomes more effective. The cons: * You have to implement a parser. Best regards from Germany. --- In [EMAIL PROTECTED] ups.com, Boon Chew <[EMAIL PROTECTED] .> wrote: > > Hi, > > I am building an app that deals with a fair bit of people relationship data > coming down as XML, so the hierarchical nature of XML actually comes in handy here. I have a few options: one is to serialize each person XML node into an object, and setup the appropriate data structure for hierarchical data traversal (e.g. rooted tree). Another option is to keep everything in memory as XML and accessed the node data via E4X. The third option is to take a hybrid approach, won't consider this route right now unless this appears to be the best. > > My concern is that instantiating thousands of objects will create a > performance issue (happened at another project that dealt with thousands of dto's), not to mention it's very slow to instantiate lots of objects. At the same time, I am not sure how fast E4X is at dealing with large XML. > > Which approach would you take? Which one is likely to scale better? Large > in-memory XML + E4X traversal or data structure with lots of objects + algorthmic tree traversal? > > - boon >