To nitpick...

In a strictly philosophical terms, in MVC, the View *may* (and
should!) directly access the Model, and on startup one *may* go
straight to a View without passing through a Controller. Also,
the Model *may* populate its own data without the help of a
Controller.

Of course when applying MVC to web applications, it's best if
all user requests go through a control layer, but MVC "per se"
does not mandate it. This practice is often referred to as the
"Front Controller" pattern.

For reference, see how MVC is applied in Smalltalk, Swing or
even MFC. :)

regards,
-Ade

-----Original Message-----
From: Martin Cooper [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 10, 2002 9:41 PM
To: 'Struts Users Mailing List'
Subject: RE: Struts + MVC Philosophical question




> -----Original Message-----
> From: Struts Newsgroup [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 10, 2002 6:40 PM
> To: [EMAIL PROTECTED]
> Subject: Struts + MVC Philosophical question
>
>
> Subject: Struts + MVC Philosophical question
> From: "André Augusto de Oliveira Aragão" <[EMAIL PROTECTED]>
>  ===
> HI!
>
> I'm using struts to develop an application. I have an action,
> that has an
> input page, and a result page. However, the input page needs
> information
> that is in the model. Following mvc, I can´t access the model
> directly from
> view. With struts, the input page is called before calling the action.
> Strictly following MVC, how can I populate the input page
> with model info I
> need? Any ideas?

Following MVC, you should not be bypassing the controller and going straight
to the view. ;-) The answer is to go through an action to get to the input
page. The action can then set up any beans the input page will need, and
then forward to it.

--
Martin Cooper


>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to