1 / 18

Dynamic form generation using a normalized database

Dynamic form generation using a normalized database. by Ann Bernstein Twin Cities CFUG September 1, 2004. MSW Fees Survey: an “e-government” project. Annual survey to find out about fees being assessed by local governments (counties, cities, towns) for solid waste management services.

fritzi
Download Presentation

Dynamic form generation using a normalized database

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Dynamic form generation using a normalized database by Ann Bernstein Twin Cities CFUG September 1, 2004

  2. MSW Fees Survey: an “e-government” project • Annual survey to find out about fees being assessed by local governments (counties, cities, towns) for solid waste management services. • Our first year as the data collection agency; we want to make a good impression! • Last year we collected other data online and it was very successful

  3. Project Requirements • secure logins for 3,000 potential users (cities, counties, and townships) • users can save data between logins • easy to use—some users are inexperienced • admin features

  4. Here’s what the survey form looks like:

  5. Tour the web app online...

  6. Two key design considerations: • nearly all data is quantitative • content of survey was not finalized when we began development.

  7. Flat file or normalized database? • We used a flat-file last time. Code was lengthy and repetitive, and therefore prone to bugs. • This time we decided to try something new and use a normalized database.

  8. Here’s a flat-file database

  9. Flat file issues: • Difficult to query data in separate columns. • Structure must be modified every time survey questions are added/deleted/modified. • Lots of empty cells in database.

  10. Here’s a normalized database

  11. Normalized db advantages: • Easy to query • Flexible— questions could be modified without changing structure. • Dense data storage • Allows for dynamic CF form!

  12. Our final database structure:

  13. Main CF pages used in survey: • Initialization page creates 2d array in session variable to store questions and answers. • Survey page loops through array to display form questions (and answers, if any exist). • Validation page plugs form data into array, checks data, and submits it to database if valid. If not, form redisplays with error highlighted.

  14. Advantages of dynamic form with normalized db • Code is short and sweet. Debugging is much faster because you’re only creating a single form element! • Questions can be added or changed until the last minute. • Data analysis is fast and easy • Application is reusable.

  15. Room for improvement (any suggestions?) • 2d array is awkward to use. • Hard to read code (what does aryQA[1][7] refer to?) • Index must correspond to key field, so keys must be kept in perfect sequence. • Admin features were afterthought & klugey • Good database design does not necessarily result in easy coding in CF.

  16. Questions/comments? Ann Bernstein (651) 215-0258 ann.bernstein @moea.state.mn.us

More Related