Thats the difference between a model 1 and model 2 architectures. Model 1 is not an MVC architecture, since there is no controller.
Paul Bourdeaux
Ranch Hand
Joined: May 24, 2004
Posts: 783
posted
0
MVC2 is a term coined to describe a web based MVC model. Technically Paul is correct, there is no design pattern named "MVC2". There is just MVC. But if you hear people start talking about MVC2 vs MVC (or even MVC1 :roll: ) they are usually referring to Model 2 vs Model 1 architecture.
Normally, when I hear the term MVC2 used in a design context, it referrs to a MVC pattern in a web application that uses some type of framework such as Struts... but this is by no means a definatation.
“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook
San Man
Greenhorn
Joined: Oct 14, 2005
Posts: 4
posted
0
Mvc 1 does not contain much interaction between servlets ,jsp and javabeans or ejb
MVc 2 has the best interaction ,u can create instance of bean in servlet and forward the page to jsp jsp should be used only for presentation,shouldn't contain much java code while servlet can contain java code but lot of business logic can be used in DAO
pulijala hari
Ranch Hand
Joined: May 14, 2005
Posts: 70
posted
0
Hello, The MVC Model 1 is driven by Page Centric application. It is suitable for small scale application where you know what would be the next jsp page in each control. Where as MVC Model 2 architecture is not page centric. The total control structure is written down in the struts-config.xml file. This is very much scalable in large applications. Hope this would solve the problem. Correct me if i am wrong.
regards, hari
Paul Bourdeaux
Ranch Hand
Joined: May 24, 2004
Posts: 783
posted
0
The total control structure is written down in the struts-config.xml file.
Struts is an example of Model 2 architecture... but it is not the only example. Model 2 and MVC can be found in othe frameworks and other programming languages. Here is an example that has nothing to do with struts:
A request is made for mypage.do.
In the web.xml, mypage.do is mapped to the MyServlet class (controller).
The MyServlet class uses the pojo (plain old java object) MyModel (model) to do some interaction with an underlying database.
Then the MyServlet class adds information to the request scope and forwards the request onto myView.jsp (view)