11
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 of Mr.Shiva Kumar Lecturer DEPARTMENT OF INFORMATION TECHNOLOGY RAMAPPA ENGINEERING COLLEGE (Accredited by NBA and Affiliated to JNTU,Hyderabad) Hunter road, warangal-506001

MODEL VIEW CONTROLLER A Technical Seminar Report submitted to Jawaharlal Nehru Technological University, Hyderabad In partial fulfillment for the requirement

Embed Size (px)

Citation preview

Page 1: MODEL VIEW CONTROLLER A Technical Seminar Report submitted to Jawaharlal Nehru Technological University, Hyderabad In partial fulfillment for the requirement

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

Page 2: MODEL VIEW CONTROLLER A Technical Seminar Report submitted to Jawaharlal Nehru Technological University, Hyderabad In partial fulfillment for the requirement

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).

Page 3: MODEL VIEW CONTROLLER A Technical Seminar Report submitted to Jawaharlal Nehru Technological University, Hyderabad In partial fulfillment for the requirement

What does MVC do…

Breaks  an application  or  even  a  piece  of application’s  interface  into  three  parts..

1. Model2. View3. Controller

Page 4: MODEL VIEW CONTROLLER A Technical Seminar Report submitted to Jawaharlal Nehru Technological University, Hyderabad In partial fulfillment for the requirement

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).

Page 5: MODEL VIEW CONTROLLER A Technical Seminar Report submitted to Jawaharlal Nehru Technological University, Hyderabad In partial fulfillment for the requirement

About MVC..MVC was originally developed to map the traditional input, processing, output roles into the GUI realm:

Input --> Processing --> OutputController --> Model --> View

Page 6: MODEL VIEW CONTROLLER A Technical Seminar Report submitted to Jawaharlal Nehru Technological University, Hyderabad In partial fulfillment for the requirement

Architectural Diagram..

ModelModel

business logic

ViewView

model representation

ControllerController

user interaction

Set State

Get State

UserActions

UpdateEvent Change

View

Page 7: MODEL VIEW CONTROLLER A Technical Seminar Report submitted to Jawaharlal Nehru Technological University, Hyderabad In partial fulfillment for the requirement

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.

Page 8: MODEL VIEW CONTROLLER A Technical Seminar Report submitted to Jawaharlal Nehru Technological University, Hyderabad In partial fulfillment for the requirement

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.

Page 9: MODEL VIEW CONTROLLER A Technical Seminar Report submitted to Jawaharlal Nehru Technological University, Hyderabad In partial fulfillment for the requirement

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. 

Page 10: MODEL VIEW CONTROLLER A Technical Seminar Report submitted to Jawaharlal Nehru Technological University, Hyderabad In partial fulfillment for the requirement

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.

Page 11: MODEL VIEW CONTROLLER A Technical Seminar Report submitted to Jawaharlal Nehru Technological University, Hyderabad In partial fulfillment for the requirement

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.