Background


We have written a program that serves up one of twenty-four questions. The questions are written directly in the source code file. But what if we want to store an unlimited number of questions? What if we would like to let people add questions without having access to our source code? Maybe we even want to let players submit questions.

We need to store our questions in an external file of some kind. We could store them in a simple text file and draw them out as needed, but there are some major problems with this approach:

  • The application must scan through and parse a lot of text to extract a particular question.

  • It requires a lot of bandwidth. We have to transfer the entire file and then dissect it. These problems tend to be exacerbated as the number of questions increases .

  • As the number of simultaneous users increases, problems of contention for bandwidth and file access occur.

  • We need to write the functions that read in and then parse the flat file. That is not fun.

  • We have to debug the functions we write. Even then, errors may occur in large-scale use that we could never simulate in a test environment. Perhaps the application crashes when the 65537th element is added because someplace we calculated an index using a 2-byte variable.



Flash and XML[c] A Developer[ap]s Guide
Flash and XML[c] A Developer[ap]s Guide
ISBN: 201729202
EAN: N/A
Year: 2005
Pages: 160

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net