• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 694
  • Last Modified:

MVC1 MVC2

HI,
I was reading about Struts and in that context about MVC Design 1 and MVC Design 2. I have not clearly understood the differences, uses, advantages, disadvantages, practical appliction of each design.
Please advise.Any ideas, suggestions, sample code, links, source code highly appreciated. Thanks in advance
MVC1MVC2.JPG
0
gudii9
Asked:
gudii9
1 Solution
 
krishna kishore mellacheruvu venkataCommented:
A Model 1 architecture consists of a Web browser directly accessing Web-tier JSP pages. The JSP pages access Web-tier JavaBeans that represent the application model, and the next view to display (JSP page, servlet, HTML page, and so on) is determined either by hyperlinks selected in the source document or by request parameters. A Model 1 application control is decentralized, because the current page being displayed determines the next page to display. In addition, each JSP page or servlet processes its own inputs (parameters from GET or POST). In some Model 1 architectures, choosing the next page to display occurs in scriptlet code, but this usage is considered poor form. (See the design guideline Section 4.2.6.8 on page 89.)

A Model 2 architecture introduces a controller servlet between the browser and the JSP pages or servlet content being delivered. The controller centralizes the logic for dispatching requests to the next view based on the request URL, input parameters, and application state. The controller also handles view selection, which decouples JSP pages and servlets from one another. Model 2 applications are easier to maintain and extend, because views do not refer to each other directly. The Model 2 controller servlet provides a single point of control for security and logging, and often encapsulates incoming data into a form usable by the back-end MVC model. For these reasons, the Model 2 architecture is recommended for most interactive applications.
0
 
gudii9Author Commented:
Can you please elaborate following
>>>is determined either by hyperlinks selected in the source document or by request parameters
How request paramenters influence next view


>>>design guideline Section 4.2.6.8 on page 89

Can you please send link for above guideline

>>>often encapsulates incoming data into a form usable by the back-end MVC model


How incoming data into form, not clear to me.

>>>directly accessing Web-tier JSP pages

What is web tier here. Does servlets also come under web tier apart from JSPs.
>>>choosing the next page to display occurs in scriptlet code

does choosing next page within scriptlet is possible

Please advise
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now