What is MVC architecture

Editorial / Best Answer

Answered by: Mitchel K

  • Jun 27th, 2005


A design pattern describes a proven solution to a recurring design problem, placing particular emphasis on the context and forces surrounding the problem, and the consequences and impact of the solution.  
 
There are many good reasons to use design patterns. Here are three: 
 
1) They are proven. You tap the experience, knowledge and insights of developers who have used these patterns successfully in their own work. 
 
2) They are reusable. When a problem recurs, you don't have to invent a new solution; you follow the pattern and adapt it as necessary. 
 
3) They are expressive. Design patterns provide a common vocabulary of solutions, which you can use to express larger solutions succinctly. 
 
The goal of the MVC design pattern is to separate the application object (model) from the way it is represented to the user (view) from the way in which the user controls it (controller).  
 
The MVC architecture has the following benefits: 
 
1) Multiple views using the same model: The separation of model and view allows multiple views to use the same enterprise model. Consequently, an enterprise application's model components are easier to implement, test, and maintain, since all access to the model goes through these components. 
 
2) Easier support for new types of clients: To support a new type of client, you simply write a view and controller for it and wire them into the existing enterprise model. 
 
3) Clarity of design: By glancing at the model's public method list, it should be easy to understand how to control the model's behavior. When designing the application, this trait makes the entire program easier to implement and maintain. 
 
4) Efficient modularity: of the design allows any of the components to be swapped in and out as the user or programmer desires - even the model! Changes to one aspect of the program aren't coupled to other aspects, eliminating many nasty debugging situations. Also, development of the various components can progress in parallel, once the interface between the components is clearly defined.  
 
5) Ease of growth: Controllers and views can grow as the model grows; and older versions of the views and controllers can still be used as long as a common interface is maintained.  
 
6) Distributable: With a couple of proxies one can easily distribute any MVC application by only altering the startup method of the application.

Showing Answers 1 - 29 of 29 Answers

satyanarayana.k

  • Jun 2nd, 2005
 

hi  
 
MVC pattern is a collabaration of three components, model(ejb,jsbc etc.,), view (jsp, html) and a controller(struts-confi.xml, and servlets). 
 
the mvc pattern is a sequence of actions interactions starting with view then controler and then to model based on the data persistence. 
 
rgds 
satyanarayana

madhu

  • Jun 2nd, 2005
 

MVC is an approach for developing interactive applications ie it results in events through user interaction.MVC stands for Model View Controller.Model is responsible for holding the application state,view is for displaying the current model and controller handles the events. 
 

  Was this answer useful?  Yes

Mitchel K

  • Jun 27th, 2005
 

A design pattern describes a proven solution to a recurring design problem, placing particular emphasis on the context and forces surrounding the problem, and the consequences and impact of the solution.  
 
There are many good reasons to use design patterns. Here are three: 
 
1) They are proven. You tap the experience, knowledge and insights of developers who have used these patterns successfully in their own work. 
 
2) They are reusable. When a problem recurs, you don't have to invent a new solution; you follow the pattern and adapt it as necessary. 
 
3) They are expressive. Design patterns provide a common vocabulary of solutions, which you can use to express larger solutions succinctly. 
 
The goal of the MVC design pattern is to separate the application object (model) from the way it is represented to the user (view) from the way in which the user controls it (controller).  
 
The MVC architecture has the following benefits: 
 
1) Multiple views using the same model: The separation of model and view allows multiple views to use the same enterprise model. Consequently, an enterprise application's model components are easier to implement, test, and maintain, since all access to the model goes through these components. 
 
2) Easier support for new types of clients: To support a new type of client, you simply write a view and controller for it and wire them into the existing enterprise model. 
 
3) Clarity of design: By glancing at the model's public method list, it should be easy to understand how to control the model's behavior. When designing the application, this trait makes the entire program easier to implement and maintain. 
 
4) Efficient modularity: of the design allows any of the components to be swapped in and out as the user or programmer desires - even the model! Changes to one aspect of the program aren't coupled to other aspects, eliminating many nasty debugging situations. Also, development of the various components can progress in parallel, once the interface between the components is clearly defined.  
 
5) Ease of growth: Controllers and views can grow as the model grows; and older versions of the views and controllers can still be used as long as a common interface is maintained.  
 
6) Distributable: With a couple of proxies one can easily distribute any MVC application by only altering the startup method of the application.

vamsi krishna

  • Jul 25th, 2005
 

MVC architecture gives the simplest way for the developing an application using J2ee technologies.In this model is where we can develop our bussiness logic and view where we can develop our presentation logic that means if you are going to use the structs framework here the model is nothing but an EJB object r it may be a model class object and view is JSP pages or servlets where u r goin to implements ur presentation logic and finaaly the controller is Action servlet in struts which is indirectly controlling the whole process.Likewise by dividing our project development we can achive highly flexible and efficient application.

Asha

  • Aug 8th, 2005
 

i have completed my BTech three years back in Electrical and electronic. Now iam learning core jave to become programer in java. 
i want job as software programer will you plz help me.

  Was this answer useful?  Yes

kalpana.m

  • Aug 31st, 2005
 

Thanks for giving the opertunity for my doubts and studied material

  Was this answer useful?  Yes

jyotiprakash das

  • Sep 7th, 2005
 

It is very informative and helpful. 
 

  Was this answer useful?  Yes

Ritesh Makwana

  • Sep 12th, 2005
 

- In the MVC design pattern, application flow is mediated by a central Controller. The Controller delegates requests to an appropriate handler. The handlers are tied to a Model, and each handler acts as an adapter between the request and the Model. The Model represents, or encapsulates, an application?s business logic or state. Control is usually then forwarded back through the Controller to the appropriate View. The forwarding can be determined by consulting a set of mappings, usually loaded from a database or configuration file. This provides a loose coupling between the View and Model, which can make an application significantly easier to create and maintain. Controller: Servlet controller which supplied by Struts itself; View: what you can see on the screen, a JSP page and presentation components; Model: System state and a business logic JavaBeans.

rahul

  • Sep 15th, 2005
 

hello,this is rahul.i can tell u one thing as ur frm other stream and hving three years gap better to learn J2EE and put some fake experience in tht .so tht u can easily find a job.if ur in hyd it is better to go for coaching for J2EE as in hyd there r few institues with good coaching centersok all the bestbut its difficult to find a job in corejavaokgood luck byeAsha Wrote: i have completed my BTech three years back in Electrical and electronic. Now iam learning core jave to become programer in java.?
i want job as software programer will you plz help me.

Sandeep

  • Sep 16th, 2005
 

The model view architacure is

model is suppose you have Button view is the Placement of Button in order i.e Ok first and then cancel ,design it is Toggle or Normal Button

and Then c is the action for button

  Was this answer useful?  Yes

Sandeep

  • Sep 16th, 2005
 

Model --> Button

View --> Toggle or JButton Or Buton

              Ok Button Or Cacel Button

              Either at Top Or Bottom or Left Or Right

              Background of Button

Controller --> Action Performed On Button

                   Ok Button  Proceed Process

                    Cancel Button Terminate It

  Was this answer useful?  Yes

SunitaSahoo

  • Sep 16th, 2005
 

Model-EJBs

View-JSP

Controller-Action

  Was this answer useful?  Yes

Shalin singh

  • Sep 17th, 2005
 

MVC Architecture most populer in Java developers that isM -> Model (Business Logic)V ->View (Interface)C -> Controler (A controler Engin)Three component combines to make a complete web application.

  Was this answer useful?  Yes

Sandeep Pralhad Kutwal

  • Sep 17th, 2005
 

MVC architecture is in JAVA SWING and J2ee .

When we consider Swing then M as Model which is Container for all Frames,Objects ,controlls that we take within application, View part for Visual appearence ,Controller is for Event Mechnism.

If U want more info about MVC then feel free to mail me.

Thanks.......San

  Was this answer useful?  Yes

JAYANT

  • Sep 28th, 2005
 

MVC architecture is MODEL VIEW CONTROLLER, its complete framework for servlet and jsp technology using struts.

  Was this answer useful?  Yes

jimmi

  • Sep 29th, 2005
 

MVC is a Architecture for creating a N-Tire Bisness Application for J2EE, it differentiats a Presentation,Login, and Database. So Developer Can Create Application ease maintaince.......

  Was this answer useful?  Yes

jahnavi

  • Oct 1st, 2005
 

MVC stands for Model-View Controller which is framework for Modelling or Designing; Viewing or updating; and having a control on the overall designing of the programme or pseudo code or thearchitecture of an object or an class.

  Was this answer useful?  Yes

Harish Rawat

  • Oct 2nd, 2005
 

This model works behind the swing components. It stands for Model-View Controller.

  Was this answer useful?  Yes

NagarajuGaddam

  • Oct 3rd, 2005
 

Hai,

Model-View-Controle

Model can serve No.Of Objects

View is JSp ,Swing

Controler(Servlet) Controlling the request and response between Model and View

  Was this answer useful?  Yes

Devidas Sonawane

  • Oct 3rd, 2005
 

MVC architecture is used in Swing. InMVC  M-Model, V-View, C-Controller model, view and controller is a nothing but Database, Graphics and Controlling is for controll model and view respectively.

  Was this answer useful?  Yes

dipali

  • Oct 10th, 2005
 

MVC is M-Model(Ejb,bens), V-View(jsp,servlets),C-Controller

Its use to decide our application in to three parts so that application will be easy to maintain and develope

http://master-in-java.blogspot.com/

  Was this answer useful?  Yes

Balakrishna

  • Oct 15th, 2005
 

Random usage of this architecture usually leads to a significant amount of scriptlets (Java code embedded within HTML code in the JSP page), especially if there is a significant amount of request processing to be performed.

 

Another limitation of Model 1 is that each JSP page must be individually responsible for managing the application state and verifying authentication and security.

 

 

 

Model 2

 

 

The benefits of this model is that Servlets do not deal with presentation logic at all but rather just process HTTP requests and control the flow of the application. The model implementing the business logic sends objects or JavaBeans to the view, therefore encouraging a much cleaner separation of business and presentation logic and making application development and maintenance much easier. This is an important factor in the recent popularity of frameworks such as Struts that implement this model.

  Was this answer useful?  Yes

Venugopal Reddy

  • Oct 18th, 2005
 

Hi Asha,

This is VenuGopal Reddy.I am working as a Associates Projects with Covansys (INDIA) Private Limited,India.Shall you send your profile to my Id(venugopalreddy.poli@gmail.com).

Thanks & Regards,

VenuGopal Reddy.P
Associate Projects
Covansys (INDIA) Private Limited

'AUGUSTA', Embassy Golflinks Biz Park,

Off Intermediate Ring Road,

Survey No. 8/1&8/4,Challaghatta Village ,

Varthur Hobli Bangalore East Taluk,

Bangalore,India-560071.
Mobile: 9886715809

Asha Wrote: i have completed my BTech three years back in Electrical and electronic. Now iam learning core jave to become programer in java. 
i want job as software programer will you plz help me.

  Was this answer useful?  Yes

Devidas Sonawane

  • Oct 25th, 2005
 

MVC is a Model, View and Controller. Model is to store contents, View is a to show contents and Controller to controll user inputs. 

  Was this answer useful?  Yes

parikshit

  • Dec 1st, 2005
 

i got ur answer,& thanx for it.

Plz send me tech. interview questions & answers of core java & jsp,servelts

bye

  Was this answer useful?  Yes

Thangeswaran

  • Apr 9th, 2006
 

Simple & Superb comment. I can understand it very easilyThank u,Regards,K.Thanges

  Was this answer useful?  Yes

view are developed by html or any other language. (presenatiotion logic). for developing views, no need of knowing about business logic.

models are developed by java,jsp (Business logic).

Controller is devloped by java. (Back bone of project)

advantages:

1. Reusability of code.

2.  Presenation logic an business logic is may developed by different persons.

3.  Easy understanding

  Was this answer useful?  Yes

Hi

   MVC architecture is a three layer architecture which seprates the pesentation layer code frm business logic.It has 3 component i.e Model,View,Controller. View is presentaion layer n in model we put business logics,connection to database etc. n controller acts as a bridge b/w view n model.

  Was this answer useful?  Yes

GERA309

  • Jul 11th, 2007
 

Let us take the senior of a web site:

 

The hit from a browser always lands on controller ie: struts-config.xml

 

Now struts-config.xml will request to model as well as to view.

 

Now all the business logic is written in Model and this model is capable of setting the required data in a bean.

 

Let us say Model has done his job and has set the bean.

 

Now the request from the controller came to view also, ie: jsp page, this jsp page is mapped with the Bean which was just set by the model..

  Was this answer useful?  Yes

Too many answers on here are limited to what tools or frameworks the programmer has used on one or more projects.  MVC is not limited to using EJB or Struts or HTML or Spring or any other particular "things" for implementing it.   MVC is a design pattern.  Devidas Sonawane gave the most concise answer (and also a correct answer), and Sanjayktiwari gave the answer I liked best. 

  Was this answer useful?  Yes

venkataramana

  • Aug 14th, 2007
 

MVC archiecture divided into three parts they are
1. View,
2. Controller
3. Prestionlogic

  Was this answer useful?  Yes

sankarraj

  • Jan 30th, 2008
 

MVC is MODEL VIEW CONTROLLER, here we can seperate view part, business part, database related part.... VIEW contains front end related part like JSP,HTML.. CONTROLLER part contains we writed our businees logic in this part, that overall control is maintaned by this controller part, MODEL part contains JDBC connections and SQL queries related part..

  Was this answer useful?  Yes

MVC -
Model
View
Controller

Model represents the business logic implementation of it i.e, service implementation
View represents the presentation logic i.e, display
Controller represents the communicator between these two or main driving components that helps interaction of these 2 components.

Thanks
Rama

  Was this answer useful?  Yes

dhilip88

  • Nov 23rd, 2010
 

Mvc architecture says that in an event that contains buttons, textboxs and panels or checkboxs..... the operation that changes this state is mvc-> clearly m-->model say button., view-->button color or state when it is On or Off., Control-->the operation of these two interfaces is done ......

  Was this answer useful?  Yes

Anil Nivargi

  • Jun 26th, 2014
 

The MVC consists of three kinds of Objects i.e Model,View and Controller. Lets start explaining one by one.

1) Model-

It handles data processing and database works part. Model processes events sent by controller. After processing these events then it sends processed data to controller (thus, controller may reprocess it) or directly to view side.

2) View-

View prepares an interface to show to the user. Controller or model tells view what to show to the user. Also view handles requests from user and informs controller.


3) Controller-

Let’s say controller is like brain of the system. That is right. Because it processes every request, prepares other parts of the system like model and view. Then the system determines what to do by controller’s commands.

  Was this answer useful?  Yes

yura

  • Dec 2nd, 2015
 

Everyone explained what is MVC...

This is outcome of one more design pattern called "separation of concerns", which means a "view" should only handle rendering logic of the model and should not be concerned with business logic similarly controller should only handle the flow of request from and to the requesting view.

In this whole process, model is shared, which is the actual bit information being rendered or forwarded between the view and controller. Example is an employee object.

We don’t use pure MVC pattern, we actually use Model2 which is a variation of pure MVC.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions