How do most developers handle typed views in ASP.NET MVC when working with large applications? We are considering the possibility of installing view-oriented models in the Models folder, and then placing all domain objects in a separate project. Thus, our controllers can easily add a domain object to a typed view if the domain object does not need to know the layout of the view itself.
For example, if we have an Employee object with:
Then our Employee View can use the ViewEmployeeModel object with:
- Employee object
- List for Status dropdown
- etc.
Is this a smart approach? Are there any better ways to do the same? It seems a little strange, since I basically have two models (one for the view, one for the business objects), but isn't it better than using untyped views?
source share