CS102 – Bilkent University

Slides:



Advertisements
Similar presentations
{ Model View Controller ASP.NET By Scott Crooks & Maggie Wettergreen.
Advertisements

Model View Controller INF 123 – Software architecture 1.
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.
Model-View-Controller ("MVC") This is a architectural design pattern for interactive applications. This design pattern organizes an interactive application.
Graphical User Interface (GUI) Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
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
Design patterns Observer,Strategi, Composite,Template (Chap 5, 6)
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.
Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc
Introduction to Java Swing “We are the sultans of swing” – Mark Knopfler.
MODEL VIEW CONTROLLER A Technical Seminar Report submitted to
MVC pattern and implementation in java
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.
MVC CompSci 230 S Software Construction. MVC Architecture  A typical application includes software to  maintain application data,  document text.
ISP666 MVC & Design Patterns. Outline Review Event Programming Model Model-View-Controller Revisit Simple Calculator Break Design Patterns Exercise.
(c) University of Washington08-1 CSC 143 Models and Views Reading: Ch. 18.
COMP 6471 Software Design Methodologies Winter 2006 Dr Greg Butler
Design Patterns Model – View – Controller. Copyright © 2001 DeLorme 28 November 2001 History ► A framework pattern for reusable applications. ► Depends.
MVC Design Pattern Web Developer at Crimshield, Inc Application Developer at IBM Present - Delta Developer at Tides.
Model View Controller (MVC) Bigger than a Pattern: It’s an Architecture Rick Mercer with help from many others 1.
JSF Framework Java Server Faces Presented by Songkran Totiya (6/10/2014)
MVC Greg Phelps Trent Spangler. AGENDA  What is MVC  Web Forms vs MVC  Example  Learn More!
Model View Controller Architecture of Java Web Applications Dr. M V S Peri Sastry, Ph.D.[BITS-Pilani]
Model View Controller MVC Web Software Architecture.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Model View Controller (MVC) Bigger than a Pattern: It’s an Architecture Rick Mercer with help from many of others 1.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 41 JavaServer Face.
Review Class Inheritance, Abstract, Interfaces, Polymorphism, GUI (MVC)
CS 151: Object-Oriented Design October 15 Class Meeting Department of Computer Science San Jose State University Fall 2013 Instructor: Ron Mak
The HotCiv GUI Instantiating the MiniDraw Framework.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 7 1COMP9321, 15s2, Week.
Chapter 8 (Horstmann’s Book) Frameworks Hwajung Lee.
ANDROID AND MODEL / VIEW / CONTROLLER. Slide 2 Design Patters Common solutions to programming problems are called design patterns Design patterns are.
Advanced Web Technologies Lecture #3 By: Faraz Ahmed.
Concordia University Department of Computer Science and Software Engineering Click to edit Master title style ADVANCED PROGRAMMING PRACTICES Model View.
Chapter 8 Frameworks. Frameworks Framework is a set of cooperating classes and interface types that structures the essential mechanisms of a particular.
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.
Chapter 3 JSP Overview. The Problem with Servlets processing the request and generating the response are both handled by a single servlet class Java programming.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 32 JavaBeans and Bean.
Model View Controller (MVC) an architecture Rick Mercer with help from many of others 1.
L10: Model-View-Controller General application structure. User Interface: Role, Requirements, Problems Design patterns: Model – View – Controller, Observer/Observable.
Introduction  “M” “V” “C” stands for “MODEL” “VIEW” “CONTROLLER”. ASP.NET MVC is an architecture to develop ASP.NET web applications in a different manner.
Java - hello world example public class HelloWorld { public static void main (String args[]) { System.out.println("Hello World"); }
Model View ViewModel Architecture. MVVM Architecture components.
Testing WebForms w/ Model-View-Presenter Erik Peterson.
Presented by Alexey Vedishchev Developing Web-applications with Grails framework American University of Nigeria, 2016 Intro To MVC Architecture.
Imposing MVC design sample in.NET. Design patterns are very useful to solve complex design issues if used well. The primary concept of the Model View.
COMP9321 Web Application Engineering Semester 2, 2016
Instantiating the MiniDraw Framework
Design Patterns Source: “Design Patterns”, Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides And Created.
© 2015 Pearson Education, Inc.
Observer Design Pattern
MVC and other n-tier Architectures
© 2015 Pearson Education, Inc.
Design Patterns Model – View – Controller
Model-View-Controller Design Pattern
EE 422C Java FX.
Model-View-Controller Patterns and Frameworks
Building Graphical User Interface with Swing a short introduction
Model-View-Controller (MVC) Pattern
Advanced ProgramMING Practices
Advanced ProgramMING Practices
Model, View, Controller design pattern
ITEC324 Principle of CS III
Presentation transcript:

CS102 – Bilkent University 06/25/12 MVC and GUIs Use of the model, view, controller design pattern in graphical user interfaces CS102 – Bilkent University

MVC (Model, View, Controller) 06/25/12 MVC (Model, View, Controller) Used to build GUI applications Separation of concerns Easy to maintain and update Model: The model represents data and the rules that govern access to and updates of this data. View: The view renders the contents of a model. If the model data changes, the view must update its presentation. Controller: The controller translates the user's interactions with the view into actions that the model will perform. Copyright © 2012 Pearson Education, Inc.

A common MVC implementation 06/25/12 A common MVC implementation

Interaction Between MVC Comps. 06/25/12 Interaction Between MVC Comps. The view: Renders the model when needed (when relevant changes happen). Registers as a listener on the model. Changes on the model will invoke a listener method in the view class. Notifies the controller when the user interacts with the view. The controller: Registers as a listener on the view. User actions performed on the view will invoke a listener method in the controller class. Updates the model based on user input (which it learns through listener calls from the view) by applying its own control policies. Copyright © 2012 Pearson Education, Inc.

Interaction Between MVC Comps. 06/25/12 Interaction Between MVC Comps. The model: Notifies the view when the model changes. Provides inspection methods to the view. Provides manipulation methods to the controller. Copyright © 2012 Pearson Education, Inc.

A Java SE Application Using MVC 06/25/12 A Java SE Application Using MVC

A Typical Interaction User changes the text: 06/25/12 A Typical Interaction User changes the text: The view notifies the controller of the change The controller updates the model The model notifies the view of the change The view redraws to reflect the change Advantages: There could be multiple views of the same model Control policies can be applied without cluttering the main jobs of rendering state (view) and managing it (model) Copyright © 2012 Pearson Education, Inc.

More than one view Multiple Views Using the Same Model 06/25/12 Copyright © 2012 Pearson Education, Inc.

06/25/12 Variations on MVC In this variation, we have the controller arbitrating between the model → view notifications. Apple Cocoa framework uses this variation of MVC. Copyright © 2012 Pearson Education, Inc.

06/25/12 Self-exercise Read the code example at: http://www.oracle.com/technetwork/articles/javase/index- 142890.html#4 Copyright © 2012 Pearson Education, Inc.