I think that you are on the right track.

Pass the XML sub-tree to the constructor to create the class. If you do this, then any change to the schema will only affect the class parsing that part of the tree. If you do the same thing to create the XML to be saved, you will get the same benefit on output.

Minimize parsing at each level so that each object only knows its own XML structure and loads its own properties. If it sees a child it should call a constructor to get the child object built.

You code should be very robust and easy to maintain. A monolithic parsing engine that maintains a complex XML file is going to be a headache every step of the way.

Ron


Paul Steven wrote:
I am creating a desktop application using Flash and Zinc. The first time it
runs, it retrieves all the data by calling a series of scripts on a server.
The data is returned as xml data.

My question is, can I just store all the info in memory as xml data or do I
need to create classes to store the info?

I need to store all this data locally so that users can use the application
later even if they are not online so I was planning on writing xml files to
the users hard drive.

Basically the application stores details of examinations and the students
associated with each exam.

I am currently reading in the xml data about each exam and using an
examination class to create instances of each exam to store the properties.
Likewise I am reading in all the data for each student and using a student
class to create instances of each student to store the properties of each
student.

I am thinking that this is not necessary and that I could just read in the
xml and use this xml data whilst the application is running. Any changes
made by the user could directly change the xml data. Then when they choose
to save their work, I would write the xml data to a text file.

Any advice on this much appreciated as I am getting a bit confused and have
spent days writing classes to deal with all the data management.

Thanks

Paul

_______________________________________________
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

Reply via email to