[Arp] Accessing views from other views
Aral Balkan
aral at ariaware.com
Thu Jan 6 14:02:59 PST 2005
Hi Keith,
>My concept of a view is that is just sends events to the
>controller and observes the model. But I'm still learning this mvc stuff.
>
I believe the issue is that there is a big difference between MVC and
having an application that separates the presentation and model.
At the application-level, for an n-Tier application, you *cannot*
implement MVC in the way that it is traditionally described. At this
scale, your View is the Client, your Model is the Server and the
Controller... well... that's where we hit the first problem. Where do we
implement the Controller? On the Client? On the Server? On both? In our
projects we usually go with the third option. Also, how does the View
observe the Model. Simply: It cannot unless you have some sort of socket
connection which is clearly infeasible. So MVC in its strictest sense is
not possible on the application-level.
Looking down to the client-level: We can separate the View and create an
Application Controller.
Zooming in to the View-level: There's nothing to stop us from
implementing a Controller for the View, whose responsibility is to
listen to and map View Events to View Commands. (I find that the
Application form fits this bill well.) Now we're getting into MVC.
Zoom in to the individual form level: Isn't the form just a controller
for its *components?*
Zoom in to the component level, we've got components with dataProviders,
etc. -- glorious MVC.
The more I work with these things, the more I see things on different
zoom levels, each with its own separation of presentation and model.
Aral
Keith Peters wrote:
>I guess it's not really that bad, there are just a lot of view events.
>I guess I'm not sure if some of them are really view events or should be
>sent to a controller.
>For instance, imagine you are viewing some content, and you want to zoom or
>rotate it. It's not affecting the model at all, so I'm handling all that in
>the view without delegating to the controller. It would seem a waste to send
>it to the controller just to have the controller send it back to the view.
>It just seems like the view is doing a whole lot more work than it seems a
>view should do. My concept of a view is that is just sends events to the
>controller and observes the model. But I'm still learning this mvc stuff. ;)
>Keith
>
More information about the Arp
mailing list