Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Is this MVC?  RSS feed

 
vishwanath nadimpally
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have a web application at the place I work. It has a jsp front-end and no servlets. The navigation is being implemented using a Navigation.xml which maps the URLs to the jsp's.
There's a java class which parses the xml and builds the corresponding look and feel for the web page.

I am not sure what this pattern is called. But i see this is a very common method of managing web apps these days. Can this be called a MVC model? Does any one know what such a pattern would be called?
 
Al Hollis
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My understanding of MVC is..

JSP for the way the content looks
Servlets for performing opperations on data
Beans for use of storing data.
 
Vijendra Runwal
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's right.The model u r talking about is MVC.
But as far as i know it's not specific to jsp's/servlets and so on.
MVC is just a framework in which we have Model, View and Controller recognised individually,that helps for faster development and better debugging and maintenance of web applications developed.

Example of MVC framework is Struts.

Hope that helps!


[ May 18, 2006: Message edited by: Vijendra Runwal ]
 
Sri Gnana
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi vishwanath
as you mentioned, you can't call it as MVC.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Al Hollis:
My understanding of MVC is..

JSP for the way the content looks
Servlets for performing opperations on data
Beans for use of storing data.


As Vijendra mentioned, MVC is not specific to Java web apps.
I believe it has its roots in SmallTalk.
I know it was used extensively in early Apple/Mac GUIs.

Usually when building Java web apps, Servlets are used as the controllers (C) and handle web flow. Beans are the Model (M) and handle the business logic and communication with other data objects (such as EJBs or JDBC databases). JSPs are the View (V), and are used for formatting the output.

I have a very simple example of this on my own site http://simple.souther.us. Look for SimpleMVC.
 
Vishwanath Rajashekar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In MVC Model-1,JSP is the one which processes the request and also acts as presentation layer.In MVC Model-2,the request is taken up by the sevlet which is pre-written by the framework vendor.Depending upon the request corresponding business logic is performed and the results are put in a Bean.The JSP will pick the results from the bean and presents to the client.
i am not very sure,but i guess it should be MVC Model1 that you are using.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vishwanath Rajashekar:
In MVC Model-1,JSP is the one which processes the request and also acts as presentation layer.In MVC Model-2,the request is taken up by the sevlet which is pre-written by the framework vendor.Depending upon the request corresponding business logic is performed and the results are put in a Bean.The JSP will pick the results from the bean and presents to the client.
i am not very sure,but i guess it should be MVC Model1 that you are using.



There isn't an MVC-1.

Model 1 is not MVC
Model 2 is MVC
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ben Souther:



There isn't an MVC-1.

Model 1 is not MVC
Model 2 is MVC


I have interviewed lot of people who make this mistake.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!