MVC Overview

Friday, February 19, 2010 Posted by Jagadeesh Manne
Model :


In the MVC architecture, model components provide an interface to the data and/or services used by an application. This way, controller components don't unnecessarily embed code for manipulating an application's data. Instead, they communicate with the model components that perform the data access and manipulation. Thus, the model component provides the business logic. Model components come in many different forms and can be as simple as a basic Java bean or as intricate as Enterprise JavaBeans (EJBs) or Web services.






View :
View components are used in the MVC architecture to generate the response to the browser. Thus, a view component provides what the user sees. Oftentimes the view components are simple JSPs or HTML pages. However, you can just as easily use WML, a templating engine such as Velocity or FreeMarker, XML with XSLT, or another view technology altogether for this part of the architecture. This is one of the main design advantages of MVC. You can use any view technology that you'd like without impacting the Model (or business) layer of your application.

Controller:
At the core of the MVC architecture are the controller components. The Controller is typically a servlet that receives requests for the application and manages the flow of data between the Model layer and the View layer. Thus, it controls the way that the Model and View layers interact. The Controller often uses helper classes for delegating control over specific requests or processes.

This information gathered from Complete Reference.

Why MVC ?
MVC separates business logic and presentation logic.So if you want to change your front end design you no need to change your back end code.if you want to change your back end you no need to change your front end.So it is very useful for updations of your project. and MVC also providing re-usability.If you want to change your project you just follow the pattern.

now we will see in next post an example of MVC architecture


MVC architecture                                                                                             MVC Example
Labels:

Post a Comment