I am using ZedGraph for charting in my project, and I am using MVC architecture. My controller will get the data I need to plot from the model and will send it to the view to plot. My doubt is, is it correct to send this data from controller to view in a “C# natural type”, as data table or array list, and convert it inside the view to PointPairList (zedgraph’s type) or the view must not contain this kind of codes inside and the controller must send the data already converted to the plotting type?
Thanks.
This situation is one of the big reasons for choosing an MVVM architecture (assuming you have that luxury). In MVVM, this kind of code would be the responsibility of the View-Model, so the View can be restricted to GUI-only code, while the Model maintains solely data representation.
Could you perhaps elaborate more on how the controller is sending the View the data, because in the MVC pattern, the View generally queries the Model to obtain data.
So using MVC you can place the conversion code in the View without the need for the Controller to be pushing data to the View.