Hi Cristian,

Model-View-Controller is a design idiom originally deve-
loped at the Xerox labs in the early 80's., primarily with
GUIs in mind back then. IIRC it has first been implemen-
ted in SmallTalk, but influenced other frameworks of the
90's in a major way, including the Document-View-Archi-
tecture of Microsoft's MFC (in fact, they bought this
framework to some degree. It has also influenced the
Java Foundation Classes framework, the entire Swing
UI makes intensive use of this design paradigm. The
basic idea behind MVC is to strictly separate the
tasks | roles associated to each component in the
Presentation layer. Basically, the View component
(screen) is what the user gets to see, the Controller
part (keyboard, mouse) coordinates the input the
user provides and controls the information flow to
the Model, which otherwise is known as the
(abstract) Business Logic which is completely
shielded from its actual representation this way.
The general concept is to shield different applica-
tion layers from each other, there's an abundance
of additional layers below the Business Logic
level | facade, with each layer providing a clearly
defined interface, abstracting and hiding the inter-
nal implementation. As long as the interface is
guaranteed, you are free to change the internal
behavior as you like later on. Look upon this all
as object orientation ported to system architec-
ture, some way.

When web technology became prominent, it was
soon decovered that the MVC concept fits quite
well there, too. In a typical, commercial-grade
web application, MVC usually is implemented in
the following way: the View component is made
of JSPs. A Servlet is assigned the Controller
task, retrieving the input the user provides
(via HTML forms), collecting the requested
information by talking to the Model (which
may be a database, an Enterprise Java Bean
or even just another (service) layer and
delivering the result back to the View part,
usually by forwarding it to JSPs that perform
the actual representation. In a more advanced
design, implemented in Struts for example,
the Controller uses a Delegate pattern
otherwise known as the 'action' approach.
In Struts, the Controller servlet handles
the entire web-specific communication,
delegating requests to specialized 'action'
classes. These are basically just normal Java
classes, having access to all the capabili-
ties the platform provides, which retrieve
or modify 'data' (in fact, by calling subse-
quent application layers) and point the
Controller to where to look for the results,
afterwards. Struts heavily makes use
of so-called 'ActionForms' in this context,
which in fact are simple Java Beans or
Value Objects in EJB slang, providing
an additional layer of abstration this
way, and uses a declarative mechanism
for telling 'what will happen next' to the
application known as 'ActionMapping'.
The Struts design is truly powerful. In
fact, it is flexible enough to replace the
entire View part, which is made of JSP
and custom taglibs currently to one
using an XML/XSLT approach. This was
originally described by two French Java
architects from orbeon.com in an article
on Java World. There is a more advanced
design around known as StrutsCX, pub-
lished and explained in a German Java
magazine some time ago. You may get
the details from

http://it.cappuccinonet.com/strutscx/

it's also available from SourceForge
now.

The Struts implementation of things
follows something to be recognized as
'MVC2'. If I'm correct, there is no fixed
definition of MVC anyway, but in a case
of doubt, I'd refer to the Struts documen-
tation first which explains the foundations
it has been developed on, too. You
can get it from here:

http://jakarta.apache.org/struts/userGuide/introduction.html#mvc


Finally, the official Sun J2EE 'blueprint'
explanation of MVC/MVC2 is to be found
here:

http://java.sun.com/blueprints/guidelines/designing_enterprise_applicati
ons_2e/web-tier/web-tier5.html

HTH,

-- Chris (SCPJ2)

> -----Original Message-----
> From: A mailing list about Java Server Pages specification
> and reference [mailto:[EMAIL PROTECTED]] On Behalf Of
> Cristian G. Amayo
> Sent: Monday, December 02, 2002 7:33 PM
> To: [EMAIL PROTECTED]
> Subject: Info about Model-View-Controller
>
>
> Hello,
>
> Does somebody remember the "Model-View-Controller" Sun
> definition (1999-2000)?
> I was trying to find the pages related at the
> http://java.sun.com site but nothing.
>
> Can somebody send me
> some links or info about?
>
> Thank you, regards.
>
> Cristian G. Amayo
> http://cgamayo.tripod.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to