Chapter 15. Views: displaying data
This chapter covers
- Presenting data with views
- Removing display code from constructors
- Passing the same model to multiple views
The console isn’t the only place where you can display information for your users; I’m pretty sure you’re keen to see how to output data on a web page! There are also desktop and phone applications, emails, and print documents to consider. Even on the console you may want the flexibility of a number of different formats for your output; maybe you want a simple text version and a fancy version with boxes and borders. You don’t want to have to rewrite large portions of your programs to change the way they present information.
Views are focused modules of code that concentrate ...