Who can change the View in MVC?

Posted by Luke on Programmers See other posts from Programmers or by Luke
Published on 2011-11-29T21:31:33Z Indexed on 2011/11/30 2:06 UTC
Read the original article Hit count: 240

I'm working on a thick client graph displaying and manipulation application. I'm trying to apply the MVC pattern to our 3D visualization component.

Here is what I have for the Model, View, and Controller:

Model - The graph and it's metadata. This includes vertices, edges, and the attributes of each. It does not contain position information, icons, colors, or anything display related.

View - This would commonly be called a scene graph. It includes the 3D display information, texture information, color information, and anything else that is related specifically to the visualization of the model.

Controller - The controller takes the view and displays it in a Window using OpenGL (but it could potentially be any 3D graphics package).

The application has various "layouts" that change the position of the vertices in the display. For instance, one layout may arrange the vertices in a circle.

Is it common for these layouts to access and change the view directly? Should they go through the Controller to access the View? If they go through the Controller, should they just ask for direct access to the View or should each change go through the controller?

I realize this is a bit different from the standard MVC example where there a finite number of Views. In this case, the View can change in an infinite number of ways. Perhaps I'm shattering some basic principle of MVC here.

Thanks in advance!

© Programmers or respective owner

Related posts about best-practices

Related posts about design-patterns