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.

Slides:



Advertisements
Similar presentations
Testing Relational Database
Advertisements

Lab 9: Code Organization User Interface Lab: GUI Lab October 23 rd, 2013.
OOP Design Patterns Chapters Design Patterns The main idea behind design patterns is to extract the high level interactions between objects and.
API Design CPSC 315 – Programming Studio Fall 2008 Follows Kernighan and Pike, The Practice of Programming and Joshua Bloch’s Library-Centric Software.
13-Jun-15 Model-View-Controller. 2 Design Patterns The hard problem in O-O programming is deciding what objects to have, and what their responsibilities.
Graphical User Interface (GUI) Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
Administrivia P2 was due already If you’re not done yet: Turn in what you can ASAP Decide whether you can really make >= 15% improvement by tomorrow Spend.
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.
Model-View-Controller. Design Patterns The hard problem in O-O programming is deciding what objects to have, and what their responsibilities are Design.
1 Design patterns Lecture 4. 2 Three Important skills Understanding OO methodology Mastering Java language constructs Recognizing common problems and.
29-Jun-15 Model-View-Controller. 2 Design Patterns The hard problem in O-O programming is deciding what objects to have, and what their responsibilities.
Object-Oriented Analysis and Design
Design patterns Observer,Strategi, Composite,Template (Chap 5, 6)
CS6320 – MVC L. Grewe THE ISSUE: Separating Implementation from Interface The business logic stays the same regardless of what the presentation is The.
14-Jul-15 Model-View-Controller. 2 Design Patterns The hard problem in O-O programming is deciding what objects to have, and what their responsibilities.
Stanford hci group / cs376 research topics in human-computer interaction UI Software Tools Scott Klemmer 27 October 2005.
Threads II. Review A thread is a single flow of control through a program Java is multithreaded—several threads may be executing “simultaneously” If you.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 16 Slide 1 User interface design.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
Dependency Injection and Model-View-Controller. Overview Inversion of Control Model-View-Controller.
MODEL VIEW CONTROLLER A Technical Seminar Report submitted to
MVC pattern and implementation in java
MVC and MVP. References enter.html enter.html
Model View Controller (MVC) Rick Mercer with a wide variety of others 1.
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
(c) University of Washington08-1 CSC 143 Models and Views Reading: Ch. 18.
Lab 10: Project and Code Organization User Interface Lab: GUI Lab Oct. 18 th, 2014.
ADTs and C++ Classes Classes and Members Constructors The header file and the implementation file Classes and Parameters Operator Overloading.
Oct R McFadyen1 Facade P Problem: There are a set of classes, a subsystem, that you need to interact with for some purpose, but you don’t.
1 Java Model-View-Controller - see programming.html#concepts.
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Design Patterns VIII Chain of Responsibility, Strategy, State.
Developing MVC based AJAX applications Kapil Mohan Rich Internet Application Developer, Uzanto Consulting A talk by.
CS160 Discussion Section Matthew Kam Apr 7, 2003.
 The scientific method comes in many different forms but always has these basic steps: 1. Ask a question 2. Develop a hypothesis (An if/then statement.
Model-View-Controller design pattern. Design Patterns “Making abstractions which are powerful and deep is an art. It requires tremendous ability to go.
Design Pattern. Definition: A design pattern is a general reusable solution to a commonly occurring problem within a given context in software design.
Java Model-View-Controller. Design Patterns The hard problem in O-O programming is deciding what objects to have, and what their responsibilities are.
PROG Developing Robust Modular Software.. Objectives What do we want? Programmatic Elements in a Business System. Logic Layer. Persistence (Data)
ANDROID AND MODEL / VIEW / CONTROLLER. Slide 2 Design Patters Common solutions to programming problems are called design patterns Design patterns are.
6-Jan-16 Model-View-Controller. 2 Design Patterns The hard problem in O-O programming is deciding what objects to have, and what their responsibilities.
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 Architecture. 2 Give someone a program, you frustrate them for a day; teach them how to program, you frustrate them for a lifetime.
L10: Model-View-Controller General application structure. User Interface: Role, Requirements, Problems Design patterns: Model – View – Controller, Observer/Observable.
CIT 590 Intro to Programming Lecture 10 (object oriented programming)
Usability Engineering Dr. Dania Bilal IS 587 Fall 2007.
12-Jun-16 Event loops. 2 Programming in prehistoric times Earliest programs were all “batch” processing There was no interaction with the user Input Output.
High degree of user interaction Interactive Systems: Model View Controller Presentation-abstraction-control.
21-Jun-16 Swing Basics and Model-View- Controller.
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.
MPCS – Advanced java Programming
On the Criteria to Be Used in Decomposing Systems into Modules
Linear Equations Linear equations are functions which have two variables. They have an independent and dependent variable. Free powerpoints at
Model-View-Controller Design Pattern
Model-View-Controller
CS102 – Bilkent University
Chapter 5: MVC Architecture Chapter 5.
Model-View-Controller Patterns and Frameworks
Event loops.
Building Graphical User Interface with Swing a short introduction
Model-View-Controller
Do Now 1) t + 3 = – 2 2) 18 – 4v = 42.
Event loops 17-Jan-19.
Model-view-controller
Event loops.
Presentation transcript:

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 are The hard problem in O-O programming is deciding what objects to have, and what their responsibilities are Design Patterns describe the higher-level organization of solutions to common problems Design Patterns describe the higher-level organization of solutions to common problems More on these later…. More on these later….

The MVC pattern MVC stands for Model-View-Controller MVC stands for Model-View-Controller The Model is the actual internal representation The Model is the actual internal representation The View (or a View) is a way of looking at or displaying the model The View (or a View) is a way of looking at or displaying the model The Controller provides for user input and modification The Controller provides for user input and modification These three components are usually implemented as separate classes These three components are usually implemented as separate classes

The Model Most programs are supposed to do work, not just be "another pretty face" Most programs are supposed to do work, not just be "another pretty face" but there are some exceptions but there are some exceptions useful programs existed long before GUIs useful programs existed long before GUIs The Model is the part that does the work--it models the actual problem being solved The Model is the part that does the work--it models the actual problem being solved The Model should be independent of both the Controller and the View The Model should be independent of both the Controller and the View But it can provide services (methods) for them to use But it can provide services (methods) for them to use Independence gives flexibility, robustness Independence gives flexibility, robustness

The Controller The Controller decides what the model is to do The Controller decides what the model is to do Often, the user is put in control by means of a GUI Often, the user is put in control by means of a GUI the GUI and the Controller are often the same the GUI and the Controller are often the same The Controller and the Model can almost always be separated (what to do versus how to do it) The Controller and the Model can almost always be separated (what to do versus how to do it) The Model should not depend on the Controller The Model should not depend on the Controller

The View Typically, the user has to be able to see, or view, what the program is doing Typically, the user has to be able to see, or view, what the program is doing The View shows what the Model is doing The View shows what the Model is doing The View is a passive observer; it should not affect the model The View is a passive observer; it should not affect the model The Model should be independent of the View, but (but it can provide access methods) The Model should be independent of the View, but (but it can provide access methods)

Combining the Controller and View Sometimes the Controller and View are combined, especially in small programs Sometimes the Controller and View are combined, especially in small programs Combining the Controller and View is appropriate if they are very interdependent Combining the Controller and View is appropriate if they are very interdependent The Model should still be independent The Model should still be independent Never mix Model code with GUI code! Never mix Model code with GUI code!

Separation of concerns As always, you want code independence As always, you want code independence The Model should not be contaminated with control code or display code The Model should not be contaminated with control code or display code The View should represent the Model as it really is, not some remembered status The View should represent the Model as it really is, not some remembered status The Controller should talk to the Model and View, not manipulate them The Controller should talk to the Model and View, not manipulate them The Controller can set variables that the Model and View can read The Controller can set variables that the Model and View can read

Model ViewController creates User input User interface Receives notifications from Retrieves state from MVC

Another view…. Model View Controller