• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Data Handling

A key element to any application is data. Data can download from an outside source or be input by the user. Putting the data in order and making sense of it is the developer’s job. If users wanted raw data, they’d read a dictionary or page through reams of database records. Although users may want options as to what data is presented, they expect the computer to process that data for them. Chapter 4, “Working with Complex Data,” discusses many ways to arrange and structure data to make processing easy and efficient for you, the developer. Chapter 5, “Presenting Data,” covers ways to present the data in a lucent manner for the user to digest.

Separating Code and Data

When handling any data, it’s best to carefully keep your programming code and presentation graphics separate from the raw data. Ideally, you will be able to modify the data without touching the code. If nothing else, your programming must adapt to expected changes to the data. If you build a tool to search an employee database, for example, it should continue to work even when new employees get hired. It’s like you know employees will be added, so you need to plan for that. Also, you’ll often have to start programming before the final content is available. Keeping code separate from the particular content means you can swap content without breaking your code. Figure 3.1 shows the folder structure I used for a project. We stored language-specific images in their own folders.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint