What do you name the "other" kind of view-model in an MVVM project?
Posted
by DanM
on Stack Overflow
See other posts from Stack Overflow
or by DanM
Published on 2010-05-20T05:43:03Z
Indexed on
2010/05/20
5:50 UTC
Read the original article
Hit count: 201
With MVVM, I think of a view-model as a class that provides all the data and commands that a view needs to bind to.
But what happens when I have a database entity object, say a Customer
, and I want to build a class that shapes or flattens the Customer class for use in a data grid. For example, maybe this special Customer object would have a property TotalOrders
, which is actually calculated using a join with a collection of Order
entities.
My question is, what do I call this special Customer
class? In other situations, I'd be tempted to call it a CustomerViewModel
, but I feel like "overloading" the notion of a view-model like this would be confusing in an MVVM project. What would you suggest?
© Stack Overflow or respective owner