Designing the data model

Now that we've defined the user interface, we need to define the underlying data models. It's critical that we have a good idea of our desired data model now before we start to code; otherwise, a new feature we need later could require a significant rewrite.

Getting on with it

The chances are that you've already got a good idea of what data models we'll need. Even so, we need to plan for future expansion since we'll eventually need to handle multiple kinds of notes. We need a model for a single note, which we'll call the "base note model" and we'll also need a model for a collection of notes, which we'll call the "Note Storage model". The base note model knows about everything that makes up a note—the name, contents, length, ...

Get PhoneGap 3.x Mobile Application Development HOTSHOT now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.