Ken,

Since we're dealing with opinions here I'll offer a perspective I've found
useful.

I never think in terms of classic MVC. It's not very helpful for me. A more
useful mental model for me is MCV. The Model and View shouldn't know about
each other at all in this mental model. The Controller in the middle is the
glue layer that isolates both from each other. It's a looser coupling that's
worked well for me.

The Model or the View can make requests for things to be done for them and
the Controller is in charge of translating those requests into something the
other guy can understand. Mental gymnastics beyond that don't add any value
for me when I'm building systems.

The utility of various mental models does vary quite widely across the
standard human population. If this one adds value to your world,  stick it
in your tool box and make liberal use of it. If it doesn't, garbage collect
it and move on.

Best,

Dwight

[EMAIL PROTECTED]
Senior Developer@GemStone a Brokat Company

> -----Original Message-----
> From: Mark Wutka [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, December 20, 2000 12:45 PM
> To:   [EMAIL PROTECTED]
> Subject:      Re: b2c best-practice object model?
>
> The view should be able to retrieve data from the model. If not, what good
> is it?  Typically, the controller is the stimulus that changes the model
> and the view renders the model's data in different ways. In a GUI
> application, the model may fire an event indicating that it has changes
> so the various views can redisplay themselves. In a web application, the
> view just fetches data from the model and displays it.
>
> The view and the model aren't mutually tightly coupled. The view is
> usually tightly coupled to the model, but the model doesn't know anything
> about the view or the controller. The idea is that you can plug in
> different views and controllers without changing the model.
>
> The JSP can go straight to the entity beans or go to a session bean
> that returns various representations of the data. That's more of an
> implementation issue.
>
> That's my opinion, anyway.
>    Mark
>
> On Wed, 20 Dec 2000, Kenneth D. Litwak wrote:
>
> >   I'd like to raise an issue here that has been bothering me.  My
> reading of how
> > MVC ought to work is that the view and the model should never
> communicate
> > directly.  Therefore, a JSP, for example, should never communicate
> directly with
> > an entity bean.  The J2EE patterns in the Blueprints seem to suggest
> athat in an
> > MVC structure, a client (JSP, servelt, et al) could communicazte to both
> a
> > session bean controller and an entity bean model.  I thinkt hat's
> problematic
> > from a performance view, as well as breaking my understanding of what
> MVC is
> > supposed to do.  IF the view talks directly to the model, then you
> haven't
> > really accomplished anything by claiming to use a design pattern.  YOu
> still
> > have the view and model tightly coupled, with the view having to do
> controler
> > work.  Any comments on this issue?  Thanks.
> >
> >
> >
> >   Ken
> >
> >
> ==========================================================================
> =
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> > of the message "signoff EJB-INTEREST".  For general help, send email to
> > [EMAIL PROTECTED] and include in the body of the message "help".
> >
>
> --
>
> Mark Wutka
> Author of Special Edition Using Java Server Pages & Servlets (ISBN:
> 0789724413)
>
> ==========================================================================
> =
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to