Chapter 5. View models
- Representing UI concepts in code
- Defining the presentation model
- Representing user input
- Scaling to complex scenarios
Part 1 of this book covered some of the big picture ideas; now we’ll start covering specific topics in depth. In this chapter, we’ll discuss the model, specifically how to approach designing models for ASP.NET MVC. When exploring the Model-View-Controller pattern, the model is often the most difficult part to understand. This is mainly because “model” is an overloaded term—it has different meanings in different contexts, which can lead to some confusion when trying to understand how it fits in with controllers and views.
A model is a representation of something meaningful. It’s ...