Home Struts MVC Architecture
Questions:Ask|Latest

 
 

Share on Google+Share on Google+

MVC Architecture

Advertisement
The main aim of the MVC architecture is to separate the business logic and application data from the presentation data to the user.

MVC Architecture

     

The main aim of the MVC architecture  is to separate the business logic and application data from the presentation data to the user.

Here are the reasons why we should use the MVC design pattern.

  1. They are resuable : When the problems recurs, there is no need to invent a new solution, we just have to follow the pattern and adapt it as necessary.
  2. They are expressive: By using the MVC design pattern our application becomes more expressive.

1).  Model: The model object knows about all the data that need to be displayed. It is model who is aware about all the operations that can be applied to transform that object. It only represents the data of an application. The model represents enterprise data and the business rules that govern access to and updates of this data. Model is not aware about the presentation data and how that data will be displayed to the browser.  

2). View : The view represents the presentation of the application. The view object refers to the model. It uses the query methods of the model to obtain the contents and renders it. The view is not dependent on the application logic. It remains same if there is any modification in the business logic. In other words, we can say that it is the responsibility of the of the view's to maintain the consistency in its presentation when the model changes.

3). Controller:  Whenever the user sends a request for something then it always go through the controller. The controller is responsible for intercepting the requests from view and passes it to the model for the appropriate action. After the action has been taken on the data, the controller is responsible for directing the appropriate view to the user. In  GUIs, the views and the controllers often work very closely together.

Difference between Model 1 and Model 2 architecture:

Features of MVC1:

  1. Html or jsp files are used to code the presentation. To retrieve the data JavaBean can be used.
  2. In mvc1 archictecture all the view, control elements are implemented using Servlets or Jsp.
  3. In MVC1 there is tight coupling between page and model as data access is usually done using Custom tag or through java bean call.

Features of MVC2:

  1. The MVC2  architecture removes the page centric property of MVC1 architecture by separating Presentation, control logic and the application state.
  2. In MVC2 architecture there is only one controller which receives all the request for the application and is responsible for taking appropriate action in response to each request.
Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: March 12, 2008

Related Tutorials

Ask Questions?    Discuss: MVC Architecture   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
amir rehman afridi
April 22, 2011
pleases explain me mvc archetacture

dear i have not get and not clear to me the above introduction y we use model view and controller. please explain me in details best regarda amir rehman afridi
wfef
June 8, 2011
sdgfsd

where is the sample code??
Arfin Meraj
July 8, 2011
MVC1 and MVC2

Best knowledge i gain from above subject.
eswar
June 12, 2013
material

My new task at my office is to convert the plain php project to mvc architecture. So if you have any materials for freshers to make this task done..Before i dont know about mvc architecture... with regards, eswar
mussarath
September 8, 2011
notes

Am very to new mvc architecture. My new task at my office is to convert the plain php project to mvc architecture. So if you have any materials for freshers to make this task done....
karthikeyan
September 13, 2011
fabulus for create a mvc framework

can any one tell teach me mvc frame work . i am very interested to learn the mvc framework.................
MUHAMMAD Junaid
November 18, 2011
Help required software project portal developemnt

Related to [[ Developemnt process ]] and [[ Framework ]] Hi I am developing a web application i.e Basic Institutional/University Students Final Year Software projects management tool and Project portal as my BS-Software engineering final year end project the application will supposed to be act like as follows : It is the automation of the University Student Final Year software project process for example every university has a pattern/way to follow/handle for that final year project student groups In our university Their exist a project COORDINATOR top authority to assign tasks project supercisor can create plan for a year for example for final year student groups and their supervisor to follow and develop project according to that plan. the plan should be in tabular form (crated by Cordinator or supervisor) that is dynamic at interface editable/coustomizable and changeable at runtime like wordpress/wijmo? the place has to be shown own approprite vies where necessary and the current task date is hyperlined if it is clicked the detaied of the task in the project plan of cordinator is shown in which links to different groups has to show and show corresponding details when clicked below the project cordinator their are multiple final year student project groups SUPERVISORS teacher(assigned and assist student for the project) the tool in the same way also assist supervisor as of cordinator it can also crate plan for their project groups that may accesible to cordinator as well and the other role is Student who can upload the project deliverables on their project page obefore the deadline of the submission so that in this way the PROJECT PORTAL keep records of all the projects(current/done) in a managed way (with proper document trasability-->can be used for sale /reused) all above + the web application also provide forum for the stuent groups and teachers facuilty + announcements + cordinator/Supervisor appoiintment request + upload task and subtask(also resubmit) + Calender(synchronizable to all the calenders)+ Instant and private messaging b/w student , groups , and teachers , view and download the allowed data (uploaded student project deliverable or template uploaded from teachers or other files) + email+ alert ..++++++ etc also work/process automation is also done for ease of the indivisuals involve in this process also A campus managemnt system is also deployed at out university ..I want to make my software such that it is (later on when editeed is capable of integrating with other systems deployed)also I want an that application that arrive requiremnet for enterprise developemnt and enterprise portal development I want to provide ease as much as I can provide on interfce (very easy and good interface) i.e the whole project plan is presented at page and in editable coustomizable tabular format each entry in table contain a page refered to the activity detls of all projects groups below their supervisor name what developemt platform will approprite for me Java / .Net / Php or merge of I have very less implementation knowledge I need your help please suggest me the paths/points in developemtn for example first of all what should be tdone then what next and what not .. M V 2 archeitecture??? Spring ? GRASP ..??? JBOSS,JUNIT, TOMCAT ? Componentone Asp.net Wijmo , WCF , WPF , Silverlight ?? I only exlored names so far and started reading about al these but I have to start the work on that project and my knowledge is very limited plz help me I by the way Want to Learn JavaEE with the help of this project and then aiming for something for future in JavaEE bases (suggest me about .Net or java (Whay not .net ?) ) also I want to reduce the work load by using reusable code and or I use open source CMS like Alfresco ??? and implement and change ??? please also provide me any type of resource that will help me BEST REGARDS MUHAMMAD Junaid
PreethiChandiraraju
December 2, 2011
project in mvc

It is highly innovative............
Venkat
February 14, 2012
Correction

The pagination at the bottom ( having red background and three white previous, index, and next links ) refers to the same page where they are. means clicking on them leads nowhere other than lands on the same page. Plz correct this.
Umarfaruk A Manguli
March 5, 2012
MVC

Send me all MVC related information , Plz.
Priya
March 17, 2012
hai

nice
Jayaram
July 26, 2012
MVC Architecture

Explination is nice,but there is no diagram and should provide the some more difference between MVC1 and MVC 2
DMCA.com