You know I was thinking about this last night a bit, but isn’t a view model just a data model for the view?
Technically it’s just a View Model pattern where the view has it’s own Model?
Really we’re just ‘encapsulating’ (god please don’t let me be one of those guys who uses this word wrong) all of the View’s behavior inside its model like we do for a “Customer” or a “Document”.
Similiarly, like a Customer who might have a child object of “Address” we have a ViewModel who would have a Child object that is “Customer”
For example we might have this:
Public class ViewModel
{
Void OnSetStateCode(string code)
{
Customer.Address.State.TwoDigitCode = code;
}
}
So is there a fundamental difference between a view model and a (Data)Model that I’m missing?