Chapter
11 Database Fundamentals |
Goals
So far we have taught our Flash client to communicate with a server via XML. Our goal in doing this was to expose our Flash client to more data and allow that data to be dynamic. While housing data on the server is more dynamic than hardcoding it into our client, we are still not doing this the optimal way. This chapter will temporarily take us away from both Flash and XML. We will begin a study of the third tier of a three tier web design; a database backend. In this chapter, we examine the fundamental principles and methods for using a relational database. Later chapters will than expand upon this knowledge, allowing us to create a database of questions which we will than relay back to the Flash client.
Background We now have written a program that serves up one of twenty-four questions. These 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. Perhaps we could store them in a simple text file, and draw them out as needed. There are some major problems with this approach:
|