Model-View-Controller Design Pattern

Slides:



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

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.
EMNLP Industry Panel Comments © 2001, David A. Evans, Clairvoyance Corporation 1June 4, 2001 The Rubber and the Road Industrial Perspectives on NLP EMNLP.
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.
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.
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
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.
Programming Paradigms Imperative programming Functional programming Logic programming Event-driven programming Object-oriented programming A programming.
MVC pattern and implementation in java
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.
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.
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.
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)
Science is a process, or method, that usually starts with an observation.
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.
What should you do if you see a fire in the lab?
Design Patterns Source: “Design Patterns”, Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides And Created.
Introduction to .NET Florin Olariu
OPERATING SYSTEMS CS 3502 Fall 2017
Support for the Development of Interactive Systems
Event loops 16-Jun-18.
State Diagrams SENG 301.
Introduction to Operating System (OS)
Solving Systems of Linear Equations using Substitution
Design and Maintenance of Web Applications in J2EE
Model-View-Controller
CS102 – Bilkent University
A logical and systematic problem solving process
Model-View-Controller Patterns and Frameworks
A Pattern Language for Software Architecture
Event loops.
Mock Science Fair Project
Building Graphical User Interface with Swing a short introduction
Model-View-Controller
3 Communicating With Graphs
Separation of Concerns
Event loops 17-Jan-19.
Event loops 17-Jan-19.
Professor John Canny Spring 2004 March 5
Algorithms and Problem Solving
Event loops 8-Apr-19.
Management From the memory view, we can list four important tasks that the OS is responsible for ; To know the used and unused memory partitions To allocate.
Model-view-controller
Tonga Institute of Higher Education IT 141: Information Systems
Solving Systems of Linear Equations using Substitution
Tonga Institute of Higher Education IT 141: Information Systems
Model, View, Controller design pattern
Dot Net Application PROF. S. LAKSHMANAN, DEPT. OF B. VOC. (SD & SA),
Learn how to choose the best strategy to solve the problem.
Professor John Canny Spring 2003 March 12
MVC overview Model, View, Controller is MVC
Why Did you choose to take Part in this work ?
Designing Experimental Investigations
Event loops.
Event loops 19-Aug-19.
A logical and systematic problem solving process
A logical and systematic problem solving process
Presentation transcript:

Model-View-Controller Design Pattern 1

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

The Model 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 But it provides services (methods) for them to use Independence gives flexibility, robustness

The View 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 is a passive observer; it should not affect the model The Model should be independent of the View (but it can provide access methods) The View should not display what the Controller thinks is happening

The Controller The Controller decides what the model is to do Often, the user is put in control by means of a GUI in this case, 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 design of the Controller depends on the Model The Model should not depend on the Controller

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

Separation of concerns As always, you want code independence 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 Controller should talk to the Model and View, not manipulate them The Controller can set variables that the Model and View can read

Summary A Model does the “business logic” It should be I/O free Communication with the Model is via methods This approach gives maximum flexibility in how the model is used The Controller organizes the program and provides input (control) to the Model The View displays what is going on in the model It should never display what should be going on in the model Especially in small programs, the Controller and View are often combined

?

References Matuszek, David - CIT 591 Programming Languages & Techniques I