The app model
The model is the data that the view and controller work on. It represents the state of the system projected on the view. To determine the model for our own app, we need to detail the features that the app supports. These features include:
- Supporting the generation of random numbers (
- Supporting input for a user to guess the value (
- Tracking the number of guesses already made (
- Giving users hints to improve their guess based on their input (
- Giving a success message if the user guesses the number correctly (
Once we have the feature list, we can now determine what data needs to be tracked and that becomes part of our model. For the preceding feature set, the elements in parentheses denote properties ...