Upload
sydney-perry
View
212
Download
0
Embed Size (px)
Citation preview
MODEL VIEW CONTROLLER
A Technical Seminar Report submitted to
Jawaharlal Nehru Technological University, Hyderabad
In partial fulfillment for the requirement for the award of B.Tech Degree in Information
Technology
By
S.Kishore Kumar 08871A12A3
Under the Guidance ofMr.Shiva Kumar
Lecturer
DEPARTMENT OF INFORMATION TECHNOLOGYRAMAPPA ENGINEERING COLLEGE
(Accredited by NBA and Affiliated to JNTU,Hyderabad)Hunter road, warangal-506001
INTRODUCTION
Model/view/controller (MVC) is a software architecture, currently considered an architectural pattern used in software engineering.
The pattern isolates "domain logic" (the application logic for the user) from the user interface(input and presentation), permitting independent development, testing and maintenance of each (separation of concerns).
What does MVC do…
Breaks an application or even a piece of application’s interface into three parts..
1. Model2. View3. Controller
Why MVC is used…Can change individual elements without affecting each other
Data can be added/removed/changed without affecting the logic of what is presented (controller) or how it is presented (view).
About MVC..MVC was originally developed to map the traditional input, processing, output roles into the GUI realm:
Input --> Processing --> OutputController --> Model --> View
Architectural Diagram..
ModelModel
business logic
ViewView
model representation
ControllerController
user interaction
Set State
Get State
UserActions
UpdateEvent Change
View
Model A model represents an application’s data and contains the logic for accessing and manipulating that dataModel services are accessed by the controller for either querying or effecting a change in the model state. The model notifies the view when a state change occurs in the model.
View The view is responsible for rendering the state of the model.The presentation semantics are encapsulated within the view, therefore model data can be adapted for several different kinds of clients. The view modifies itself when a change in the model is communicated to the view. A view forwards user input to the controller.
Controller The controller is responsible for intercepting and translating user input into actions to be performed by the model. The controller is responsible for selecting the next view based on user input and the outcome of model operations.
Application..An MVC application may be a collection of model/view/controller triads, each responsible for a different UI element. The Swing GUI system, for example, models almost all interface components as individual MVC systems.MVC is often seen in web applications where the view is the HTML or XHTML generated by the app. The controller receives GET or POST input and decides what to do with it, handing over to domain objects (i.e. the model) that contain the business rules and know how to carry out specific tasks such as processing a new subscription, and which hand control to (X)HTML-generating components such as templating engines, XML pipelines, Ajax callbacks, etc.
Advantage..
They are reusable : 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. They are expressive: By using the MVC design pattern our application becomes more expressive.