I have a problem at the conceptual level, I read a lot but I’m not out yet.
I would like to model a system that plans to place orders and allows you to choose the products according to the selected location.
In the analysis phase it is right that is the user interface to request data to the classes product, location and orders?
In the design phase, can view access to multiple models and display the data or is more correct if the orderView access only to the order model and this takes all the data from the database (using different DAO for location, order and product)?
Thanks in advance, Vincenzo
I have a problem at the conceptual level, I read a lot but I’m
Share
An approach to solve this is to use a ViewModel (http://geekswithblogs.net/michelotti/archive/2009/10/25/asp.net-mvc-view-model-patterns.aspx), basically a composite model that groups several other models together so that they can be serviced to a view.
So if you have a Product model and a Location model and an Order model, all logically distinct models that you want to combine together on a single view (e.g. Monthly Sales Summary), you could create a SalesSummaryViewModel that contains products, orders, and locations to be returned to that view.