CS6320 – MVC L. Grewe THE ISSUE: Separating Implementation from Interface The business logic stays the same regardless of what the presentation is The.

Slides:



Advertisements
Similar presentations
Lab 9: Code Organization User Interface Lab: GUI Lab October 23 rd, 2013.
Advertisements

Apache Struts Technology
OOP Design Patterns Chapters Design Patterns The main idea behind design patterns is to extract the high level interactions between objects and.
MVC Nick Lopez Duplication of course material for any commercial purpose without the explicit written permission of the professor is prohibited.
1 SWE Introduction to Software Engineering Lecture 22 – Architectural Design (Chapter 13)
Lecture 23: Software Architectures
Graphical User Interface (GUI) Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
James Tam Introduction To Design Patterns You will learn about design techniques that have been successfully applied to different scenarios.
Graphical User Interface (GUI) Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
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.
Structure of a web application1 Dr Jim Briggs. MVC Structure of a web application2.
Stanford hci group / cs376 research topics in human-computer interaction UI Software Tools Scott Klemmer 27 October 2005.
TimeTracker 2, Take 1  Servlets Web Interface (jsp) Servlet (business logic and processing) App Engine Datastore Form Submit R/W.
Design Patterns academy.zariba.com 1. Lecture Content 1.What are Design Patterns? 2.Creational 3.Structural 4.Behavioral 5.Architectural 6.Design Patterns.
Who am I? ● Catalin Comanici ● QA for 10 years, doing test automation for about 6 years ● fun guy and rock star wannabe.
Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc
BY VEDASHREE GOVINDA GOWDA
Dependency Injection and Model-View-Controller. Overview Inversion of Control Model-View-Controller.
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
MODEL VIEW CONTROLLER A Technical Seminar Report submitted to
MVC pattern and implementation in java
Java Beans.
Architectural separation (MVC, arch model, Seeheim).
MVC and MVP. References enter.html enter.html
Model View Controller (MVC) Rick Mercer with a wide variety of others 1.
Copyright © 2012 Accenture All Rights Reserved.Copyright © 2012 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are.
CS 160: Software Engineering October 8 Class Meeting
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.
CS 240, Prof. Sarwar Slide 1 CS 240: Software Project Fall 2003 Sections 1 & 2 Dr. Badrul M. Sarwar San Jose State University Lecture #13.
Lecturer: Prof. Piero Fraternali, Teaching Assistant: Alessandro Bozzon, Advanced Web Technologies: Struts–
Case Study + MVC Lec Error Pages By means of the page directive, a JSP can be given the responsibility of an Error page An Error JSP will be called.
Chapter 6 – Architectural Design CSE-411, Dr. Shamim H Ripon.
COMP 6471 Software Design Methodologies Winter 2006 Dr Greg Butler
MVC Design Pattern Web Developer at Crimshield, Inc Application Developer at IBM Present - Delta Developer at Tides.
Swing MVC Application Layering A Layer is a collection of components that Perform similar tasks. Perform similar tasks. Isolate implementation details.
Model View Controller (MVC) Bigger than a Pattern: It’s an Architecture Rick Mercer with help from many others 1.
1 CSC 222: Object-Oriented Programming Spring 2012 netBeans & GUIBuilder  netBeans IDE create/edit/run a project  GUIBuilder JFrame, JButton, JTextField,
CSC 2720 Building Web Applications Frameworks for Building Web Applications.
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.
Microsoft Visual Basic 2008 CHAPTER ELEVEN Multiple Classes and Inheritance.
Designing Classes. Software changes Software is not like a novel that is written once and then remains unchanged. Software is extended, corrected, maintained,
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
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
MVC WITH CODEIGNITER Presented By Bhanu Priya.
1 Copyright © 2004, Oracle. All rights reserved. Oracle Application Development Framework.
 An essential supporting structure of any thing  A Software Framework  Has layered structure ▪ What kind of functions and how they interrelate  Has.
Model View Controller (MVC) an architecture Rick Mercer with help from many of others 1.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
Expense Tracking System Developed by: Ardhita Maharindra Muskan Regmi Nir Gurung Sudeep Karki Tikaprem Gurung Date: December 05 th, 2008.
SDJ INFOSOFT PVT. LTD. 2 BROWSERBROWSER JSP JavaBean DB Req Res Application Layer Enterprise server/Data Sources.
Presented by Alexey Vedishchev Developing Web-applications with Grails framework American University of Nigeria, 2016 Intro To MVC Architecture.
Design Patterns Source: “Design Patterns”, Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides And Created.
Structure of a web application
JSP (Java Server Page) JSP is server side technology which is used to create dynamic web pages just like Servlet technology. This is mainly used for implementing.
MVC and Design Patterns
Model-View-Controller Design Pattern
Design and Maintenance of Web Applications in J2EE
CS102 – Bilkent University
Model-View-Controller Patterns and Frameworks
Model-View-Controller (MVC) Pattern
Model-View-Controller
Advanced ProgramMING Practices
Model-view-controller
Presentation transcript:

CS6320 – MVC L. Grewe

THE ISSUE: Separating Implementation from Interface The business logic stays the same regardless of what the presentation is The business logic stays the same regardless of what the presentation is The business logic does not depend on the presentation medium, and different presentation media may be used for the same business logic The business logic does not depend on the presentation medium, and different presentation media may be used for the same business logic Separating the business logic from the presentation results in more modular and reusable code Separating the business logic from the presentation results in more modular and reusable code

The MVC Framework MVC = Model – View – Controller MVC = Model – View – Controller Model = Data (state of entity) Model = Data (state of entity) View = Interface (visualization of entity) View = Interface (visualization of entity) Controller = Business Logic - communication between the interface and the data layer Controller = Business Logic - communication between the interface and the data layer The controller may be a separate class, or just specific methods in the business logic class that are used for the communicationThe controller may be a separate class, or just specific methods in the business logic class that are used for the communication

MVC Pattern

The Model Object Knows about the data needed to be manipulated Knows about the data needed to be manipulated Knows about the business logic, including operations that can be performed on the data Knows about the business logic, including operations that can be performed on the data Data should be accessed and manipulated using methods, independent of the GUI Data should be accessed and manipulated using methods, independent of the GUI e.g., A clock – the model only keeps track of the time, with an internal representation, and does not have anything to do with how it is displayed e.g., A clock – the model only keeps track of the time, with an internal representation, and does not have anything to do with how it is displayed Will allow external controls to modify state Will allow external controls to modify state

The View Object Should refer to the model to update its display Should refer to the model to update its display Query the model using accessor methods to retrieve data from the model Query the model using accessor methods to retrieve data from the model Same model can have different views: Same model can have different views: A clock can have an analog viewA clock can have an analog view A clock can have a digital viewA clock can have a digital view A clock can be used as a timer/stopwatchA clock can be used as a timer/stopwatch Note that the model for all of the above is the sameNote that the model for all of the above is the same Different views would have no bearing on the intrinsic behavior of the model Different views would have no bearing on the intrinsic behavior of the model

The Controller Object Knows about physical means by which users manipulate data in the model Knows about physical means by which users manipulate data in the model Responds to events from the GUI and translates them to method calls for the model Responds to events from the GUI and translates them to method calls for the model Usually sits between the user interface and the model – and calls model methods based on view operations Usually sits between the user interface and the model – and calls model methods based on view operations e.g., setting the time of a clock by typing in the current time would cause the controller to trap the action event and calling, say, the “setTime” method of clocke.g., setting the time of a clock by typing in the current time would cause the controller to trap the action event and calling, say, the “setTime” method of clock Often controller will not need interaction of the model (e.g., for sorting a view) Often controller will not need interaction of the model (e.g., for sorting a view)

What does this mean? When you design business logic classes, you should not use any explicit I/O (except for test code – maybe in the main() method) When you design business logic classes, you should not use any explicit I/O (except for test code – maybe in the main() method) All interaction between business logic classes and the outside world through public methods All interaction between business logic classes and the outside world through public methods When you use interface classes (application classes, servlets, JSP) you should not use any explicit business logic When you use interface classes (application classes, servlets, JSP) you should not use any explicit business logic Only code in interfaces classes should be class instantiation and method calls Only code in interfaces classes should be class instantiation and method calls