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".