Fundamentals of Programming I The Model/View/Controller Design Pattern

Slides:



Advertisements
Similar presentations
Chapter 18 Building the user interface. This chapter discusses n Javas graphical user interface. n Swing: an enhancement of a library called the Abstract.
Advertisements

Computer Science 112 Fundamentals of Programming II User Interfaces
An Introduction to Visual Basic Terms & Concepts.
AP Computer Science A – Healdsburg High School 1 Unit 3 - Classes and Objects - Example.
 An operating system (OS) is a set of computer programs that allow the user to perform basic tasks like copying, moving, saving and printing files. 
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.
Object-Oriented Analysis and Design
Chapter 7 Improving the User Interface
Graphical User Interfaces A Quick Outlook. Interface Many methods to create and “interface” with the user 2 most common interface methods: – Console –
Computer Science 111 Fundamentals of Programming I User Interfaces Introduction to GUI programming.
CS 0004 –Lecture 1 Wednesday, Jan 5 th, 2011 Roxana Gheorghiu.
An Introduction to Visual Basic
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
Model-View-Controller Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University.
Computer Science 111 Fundamentals of Programming I Model/View/Controller and Data model design.
Introduction to Windows Programming
Computer Science 112 Fundamentals of Programming II Command Buttons and Responding to Events.
CSCE 121: Introduction to Program Design and Concepts, Honors Dr. J. Michael Moore Spring 2015 Set 15: GUIs 1.
1 CSC 222: Object-Oriented Programming Spring 2012 netBeans & GUIBuilder  netBeans IDE create/edit/run a project  GUIBuilder JFrame, JButton, JTextField,
How the Session Works Outline Practical on arrival Talk 1 Reflect on practical Clarify concepts Practical exercises at your own pace Talk 2: Further concepts.
Graphical User Interface You will be used to using programs that have a graphical user interface (GUI). So far you have been writing programs that have.
Event Handling Tonga Institute of Higher Education.
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.
Purpose of Operating System Monil Adhikari. Agenda Introduction Responsibilities of Operating System User Interfaces Command Line Interface Graphical.
Java - hello world example public class HelloWorld { public static void main (String args[]) { System.out.println("Hello World"); }
Operating Systems Concepts 1/e Ruth Watson Chapter 1 Chapter 1 Introduction to Operating Systems Ruth Watson.
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.
Computer Science 112 Fundamentals of Programming II Data Fields for I/O and Message Boxes for Error Recovery.
Programming Paradigms, Software Architectural Patterns, and MVC CS 378 – Mobile Computing for iOS Dr. William C. Bulko.
CSC 108H: Introduction to Computer Programming Summer 2011 Marek Janicki.
CSC 222: Object-Oriented Programming
Topics Graphical User Interfaces Using the tkinter Module
PYGAME.
Computer Science 111 Fundamentals of Programming I
Visual Basic Code & No.: CS 218
Chapter Topics 15.1 Graphical User Interfaces
Event-driven programming
GUIs Model/View/Controller Pattern Using BreezySwing
Event loops 16-Jun-18.
Chapter 2 – Introduction to the Visual Studio .NET IDE
1. Introduction to Visual Basic
Understand Windows Forms Applications and Console-based Applications
An Introduction to Visual Basic
Computer Science 112 Fundamentals of Programming II GUIs II:
Ellen Walker Hiram College
Fundamentals of Python: From First Programs Through Data Structures
Chapter 2 Visual Basic Interface
Event Driven Programming
Basic Elements of The GUI
CIS16 Application Development Programming with Visual Basic
Event loops.
Computer Fundamentals
Event loops 17-Jan-19.
Event loops 17-Jan-19.
Fundamentals of Programming I Windows, Labels, and Command Buttons
Computer Science 111 Fundamentals of Programming I User Interfaces
Fundamentals of Programming I The Model/View/Controller Design Pattern
Computer Science 111 Fundamentals of Programming I
Chapter 15: GUI Applications & Event-Driven Programming
Event loops 8-Apr-19.
Tonga Institute of Higher Education
05 | Desktop Applications
Graphical User Interfaces
The University of Texas – Pan American
Event loops.
ACM programming contest
Event loops.
Event loops 19-Aug-19.
Presentation transcript:

Fundamentals of Programming I The Model/View/Controller Design Pattern Computer Science 111 Fundamentals of Programming I The Model/View/Controller Design Pattern

TUI vs GUI Text-based I/O Direct manipulation Sequential process Event-driven process

TUI vs GUI Text-based I/O Sequential process Direct manipulation Event-driven process

The Model/View Pattern Data Model View (User Interface) The data model consists of software components that manage a system’s data The view consists of software components that allow human users to view and interact with the data model The view can be a TUI or a GUI, on the same data model

Model/View Pattern Classes in the data model, such as WarGame, Player, Deck, and Card, manage the application’s data Classes in the view, such as WarGUI, EasyFrame, PhotoImage, Button, and Label, present the data to users

The Data Model for the War Game Player 2 WarGame Deck 0..52 Card

The Data Model and the View (GUI) Button Player 2 2 EasyFrame WarGUI WarGame displays 3 Label Deck 0..52 Card

The Data Model for the Craps Game Die 2 CrapsGame

The Data Model and the View (GUI) Button Die 2 2 EasyFrame GrapsGUI CrapsGame displays 3 Label

Model/View/Controller Pattern GUI-based, event-driven programs can be further decomposed by gathering code to handle user interactions into a third component called the controller Displays data Manages data View Model Controller Responds to user events

The Controller In Python, the controller consists of the methods that respond to user events These methods are defined in the main view class, and are associated with the command attribute of the buttons Other types of widgets can have their own event-handling methods

Event-Driven Programming Set up a window with its widgets Connect it to a data model Wait for users to press buttons, enter text, drag the mouse, etc. Respond to these events by running methods that update the data model and the view

A Banking System BankManager SavingsAccount ATM * Bank File storage

Have a nice Thanksgiving, and safe travels!