MVC pattern and implementation in java

Slides:



Advertisements
Similar presentations
Apache Struts Technology
Advertisements

OOP Design Patterns Chapters Design Patterns The main idea behind design patterns is to extract the high level interactions between objects and.
1 Model View Controller. 2 Outline Review Definitions of MVC Why do we need it? Administiriva Changing the display Event flow Dragging at interactive.
BehavioralCmpE196G1 Behavioral Patterns Chain of Responsibility (requests through a chain of candidates) Command (encapsulates a request) Interpreter (grammar.
Graphical User Interface (GUI) Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
Overview of Swing’s MVC Architecture By Geoffrey Steffens (BCSi), Socket Software, Australia Copyright © Socket Software, 2002.
Graphical User Interface (GUI) Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Component Based Systems Analysis Introduction. Why Components? t Development alternatives: –In-house software –Standard packages –Components 60% of the.
MVC Fall 2005 OOPD John Anthony. Design Patterns The hard problem in O-O programming is deciding what objects to have, and what their responsibilities.
Object-Oriented Analysis and Design
Application Architectures Vijayan Sugumaran Department of DIS Oakland University.
CS6320 – MVC L. Grewe THE ISSUE: Separating Implementation from Interface The business logic stays the same regardless of what the presentation is The.
Model View Controller (MVC) Architecture. Terminology and History MVC evolved from Smalltalk-80 Has become a key pattern in web based applications – If.
Graphical User Interface (GUI) Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Apache Struts Technology A MVC Framework for Java Web Applications.
Stanford hci group / cs376 research topics in human-computer interaction UI Software Tools Scott Klemmer 27 October 2005.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
Overview of Design Patterns & The MVC Design Pattern Sapana Mehta.
1 Architectural Patterns Yasser Ganji Saffar
UNIT-V The MVC architecture and Struts Framework.
Dependency Injection and Model-View-Controller. Overview Inversion of Control Model-View-Controller.
MODEL VIEW CONTROLLER A Technical Seminar Report submitted to
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Design Patterns.
MVC and MVP. References enter.html enter.html
Model View Controller (MVC) Rick Mercer with a wide variety of others 1.
An Introduction to Software Architecture
Model-View-Controller Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University.
MVC CompSci 230 S Software Construction. MVC Architecture  A typical application includes software to  maintain application data,  document text.
® IBM Software Group © 2007 IBM Corporation J2EE Web Component Introduction
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 Architectural Styles.
(c) University of Washington08-1 CSC 143 Models and Views Reading: Ch. 18.
Chapter 6 – Architectural Design CSE-411, Dr. Shamim H Ripon.
COMP 6471 Software Design Methodologies Winter 2006 Dr Greg Butler
User Interface Programming in C#: Model-View-Controller Chris North CS 3724: HCI.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Architectural Patterns Support Lecture. Software Architecture l Architecture is OVERLOADED System architecture Application architecture l Architecture.
3461 Model-View Controller Advanced GUI concepts.
Swing MVC Application Layering A Layer is a collection of components that Perform similar tasks. Perform similar tasks. Isolate implementation details.
GoF: Document Editor Example Rebecca Miller-Webster.
Model View Controller (MVC) Bigger than a Pattern: It’s an Architecture Rick Mercer with help from many others 1.
Model View Controller Architecture of Java Web Applications Dr. M V S Peri Sastry, Ph.D.[BITS-Pilani]
Developing MVC based AJAX applications Kapil Mohan Rich Internet Application Developer, Uzanto Consulting A talk by.
Model View Controller MVC Web Software Architecture.
Model View Controller (MVC) Bigger than a Pattern: It’s an Architecture Rick Mercer with help from many of others 1.
Review Class Inheritance, Abstract, Interfaces, Polymorphism, GUI (MVC)
Behavioral Patterns1 Nour El Kadri SEG 3202 Software Design and Architecture Notes based on U of T Design Patterns class.
ANDROID AND MODEL / VIEW / CONTROLLER. Slide 2 Design Patters Common solutions to programming problems are called design patterns Design patterns are.
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
1 CSE 331 Model/View Separation and Observer Pattern slides created by Marty Stepp based on materials by M. Ernst, S. Reges, D. Notkin, R. Mercer, Wikipedia.
MVC WITH CODEIGNITER Presented By Bhanu Priya.
Model View Controller (MVC) an architecture Rick Mercer with help from many of others 1.
Chapter 9 Web Application Design. Objectives Describe the MVC design pattern as used with Web applications Explain the role and responsibilities of each.
L10: Model-View-Controller General application structure. User Interface: Role, Requirements, Problems Design patterns: Model – View – Controller, Observer/Observable.
Model View ViewModel Architecture. MVVM Architecture components.
Apache Struts Technology A MVC Framework for Java Web Applications.
High degree of user interaction Interactive Systems: Model View Controller Presentation-abstraction-control.
CLASSIFICATION OF DESIGN PATTERNS Hladchuk Maksym.
Presented by Alexey Vedishchev Developing Web-applications with Grails framework American University of Nigeria, 2016 Intro To MVC Architecture.
MODEL VIEW CONTROLLER PATTERN. Model View Controller MVC is a time tested method of separating the user interface of an application from its Domain Logic.
J2EE Platform Overview (Application Architecture)
Design Patterns Source: “Design Patterns”, Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides And Created.
Support for the Development of Interactive Systems
CS102 – Bilkent University
Model-View-Controller Patterns and Frameworks
Model-View-Controller (MVC) Pattern
Patterns.
Model-view-controller
Model, View, Controller design pattern
Presentation transcript:

MVC pattern and implementation in java

Agenda Context Problem Solution What is MVC? MVC Architecture Common MVC Implementation MVC Interaction Order MVC Pattern MVC Responsibilities Advantages of MVC Implementation of MVC

CONTEXT Interactive applications with a flexible human-computer interface

PROBLEM DEFINITION User interfaces are especially prone to change requests. Different user place conflicting requirements on the user interface. Building a system with the required flexibility is expensive and error-prone if the user interface is tightly interwoven with the functional core.

PROBLEM DEFINITION The following forces influence the solution The same information is presented differently in different windows, for example, in a bar or pie chart. The display and behavior of the application must reflect data manipulations immediately. Changes to the user interface should be easy, and even possible at run-time. Support different ‘look and feel’ standards or porting the user interface should not affect code in the core of the application.

SOLUTION MVC – Model View Controller

What is MVC? MVC - Model-View-Controller - is a design pattern for the architecture of web applications. It is a widely adopted pattern, across many languages and implementation frameworks, whose purpose is to achieve a clean separation between three components of most any web application.

MVC Architecture The Model represents the structure of the data in the application, as well as application-specific operations on those data. The View renders the contents of a model. It specifies exactly how the model data should be presented. The Controller translates user actions (mouse motions, keystrokes, words spoken, etc.) and user input into application function calls on the model, and selects the appropriate View based on user preferences and Model state.

Cond… The MVC architecture divides an application (code) required to manage a user interface into three parts: Data components maintain the raw application data and application logic for the interface –model. Presentation components provide the visual representation(s) of the data --view (usually to the screen). Input-processing components handle input from the user by modifying the model--controller.

Common MVC Implementation

MVC Actions Model -- Notify view about data updates View --Change rendering as needed Controller --Select view to be rendered based on event notifications and method invocations

MVC Interaction Order User performs action, controller is notified. Controller may request changes to model. Controller may tell view to update. Model may notify view if it has been modified. View may need to query model for current data. View updates display for user. 6 View 4 Model 5 3 1 Controller 2

MVC Pattern – Model Contains application & its data Provide methods to access & update data Interface defines allowed interactions Fixed interface enable both model & GUIs to be easily pulled out and replaced Examples:- Text documents Spreadsheets Web browser Video games

MVC Pattern – View Provides visual representation of model. Multiple views can display model at same time. When model is updated, all its views are informed & given chance to update themselves.

MVC Pattern – Controller Users interact with the controller Interprets mouse movement, keystrokes, etc. Communicates those activities to the model Interaction with model indirectly causes view(s) to update

model responsibilities store data in properties implement application methods (e.g., ClockModel.setTime() or ClockModel.stop()) provide methods to register/unregister views notify views of state changes

view responsibilities create interface update interface when model changes forward input to controller controller responsibilities translate user input into changes in the model if change is purely cosmetic, update view

Advantages of MVC Separating Model from View (that is, separating data representation from presentation). More robust Easier to maintain permits run-time selection of appropriate Views based on workflow, user preferences, or Model state. Separating Controller from Model (application behavior from data representation) allows configurable mapping of user actions on the Controller to application functions on the Model.

Easy to add multiple data presentations for the same data. Multi-view applications (overview+detail, brushing,…) Different users Different UI platforms (mobile, client-side, server-side,…) Alternate designs GUI Model GUI Model GUI

Cond… Facilitates adding new types of data presentation as technology develops. Model and View components can vary independently enhancing maintainability ,extensibility, and testability. allows user interfaces (views) to be easily added, removed, or changed allows response to user input (controller) to be easily changed

COND… changes can happen dynamically at runtime promotes code reuse (e.g., one view might be used with different models) allows multiple developers to simultaneously update the interface, logic, or input of an application without affecting other source code.

Implementation of MVC

THANK YOU…..