The diagram comes from section 1.4 of the J2EE Blueprints: Introduction to the 
Blueprints at Sun.

http://java.sun.com/blueprints/guidelines/designing_enterprise_applications/introduction/summary/index.html#1035154


Steven Banks
368-0566

>>> "Robert Taylor" <[EMAIL PROTECTED]> 05/15/02 02:47PM >>>
The problem with accessing the model directly from the view is that if for
some reason an error were to occur while accessing the model, then there is
no mechanism to notify the user with a meaningful message.

For example:

If I had a custom select tag which retrieved a list of companies where the
list was retrieved from the database and it was unable to retrieve the list,
then there is no intuitive way for the user to know what went wrong besides
an empty drop down box.

Where as if  your Action (controller) were responsible for retrieving the
list and placing it in the appropriate scope for the view to access and an
error occurred, then the user could be forwarded/redirected to the
appropriate view which contained meaningful information about the error.

Although I have not yet seen it, I would have to believe the diagram meant
the view _indirectly_ accesses the model via the controller.

robert

> -----Original Message-----
> From: Dan Cancro [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, May 15, 2002 1:28 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Application State == View or Business Logic
>
>
> I thought that a view could access a model directly to display the model's
> state.  There used to be a MVC2 diagram on the Struts site that had a line
> connecting the view directly to the model.  Does Struts work differently
> now?  That was a good diagram.  I wish it was easier to find.
>
> Thanks,
> Dan
>
> > -----Original Message-----
> > From: Ted Husted [mailto:[EMAIL PROTECTED]] 
> > Sent: Wednesday, May 15, 2002 9:44 AM
> > To: Struts Users Mailing List
> > Subject: Re: Application State == View or Business Logic
> >
> >
> > In remote applications, including Web applications, MVC is usually
> > moderated by the Layers pattern, so that the View and the Controller
> > interact and the Controller and Model interact, but the View and Model
> > do not interact.
> >
> > V <-> C <-> M <-> (persistent store)
> >
> >
> > -- Ted Husted, Husted dot Com, Fairport NY US
> > -- Developing Java Web Applications with Struts
> > -- Tel: +1 585 737-3463
> > -- Web: http://husted.com/about/services 
> >
>
> --
> 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