• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Code Data Separation

All programmers should strive to keep code (that is, the programming scripts) separate from the data (or the project-specific content such as text and graphics). By keeping code separate from data, you enable all your programming efforts to transfer easily to other projects. Similarly, when you want to make a major change to the content—say, redo the entire project in a different language—you just need to replace data without touching (or breaking) the code. It’s a great concept that is sometimes difficult to achieve.

Imagine a factory that produces furniture with a wide selection of fabric upholstery. Likely the upholstery (think “data”) is kept separate from the furniture and padding (think “code”) until an order is placed. The benefit of code data separation (in this analogy) is that the factory can easily produce furniture as its customers request it and never have additional stock that’s already upholstered. Applying this to Flash isn’t much different. Assume that your Flash site has graphic buttons that display a floating tooltip whenever the user places his cursor over the button. If you kept the code (the script that makes the tooltip appear) separate from the data (the actual text or words that appear in the tooltip), you could easily translate this to another language by replacing the text for the tooltips. Ideally, you would keep all the text for all the tooltips in one location to make translation that much easier. The main idea is that you want to be able to make significant changes to either the code or data without affecting the other.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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