Ray Zimmerman wrote:
> If I understand correctly, the Mason component that generates the page 
> the user sees would be considered the View. But where is the Controller?

I wrote a little about this in my templating guide, and there has been 
discussion on the Mason list.  A common approach is to use Mason's 
autohandlers as controllers, but you could really use any component. 
Just have it do some work in perl, gather some data, and then pass it 
off to a view component that generates the HTML.

> This is code I
> would normally have put in the <%init> section of the display component 
> (with a possible redirect to another component based on application 
> logic). This sounds like C and V are not separated as they should be.

That's a standard way to do it in Mason, but not an MVC way.  To make it 
more MVC, you need to have separate components for C and V, with V just 
receiving data and displaying it in HTML.

- Perrin


Reply via email to