Section 8: Model-View-Controller

Similar documents
Section 8: Model-View-Controller. Slides adapted from Alex Mariakakis, with material from Krysta Yousoufian and Kellen Donohue

A physicist, an engineer and a programmer were in a car driving over a steep alpine pass when the brakes failed. The car was getting faster and

Old Kings Oval Electronic Scoreboard. Scoreboard Operation and Advanced Scoring Instructions

EWC EARLY WARNING CONTROL OPERATIONAL PRESENTATION. Charles Dickens (757)

Click on the menu icon in the left corner to open the menu. From the menu you can:

Full-Time Cup Competitions Version 5.0

To Logon On to your tee sheet, start by opening your browser. (NOTE: Internet Explorer V. 6.0 or greater is required.)

OMS Alerts with Milsoft IVR Written by: Darcy O Neal Presented by: Clayton Tucker

TECHNICAL NOTE HOW TO USE LOOPERS. Kalipso_TechDocs_Loopers. Revision: 1.0. Kalipso version: Date: 16/02/2017.

Company Surge TM for. Installation Guide v4.0 January

Module 3 Developing Timing Plans for Efficient Intersection Operations During Moderate Traffic Volume Conditions

SQL LiteSpeed 3.0 Installation Guide

Look Up! Positioning-based Pedestrian Risk Awareness. Shubham Jain

GolfNow Central. Rates & Inventory User Guide. February 2018

Team Manager's Manual

System Administration Tasks

Visual Traffic Jam Analysis Based on Trajectory Data

Case Study. PayPal s Sparkline Case Study. About Sparkline

[XACT INTEGRATION] The Race Director. Xact Integration

Exemplary Conditional Automation (Level 3) Use Case Description Submitted by the Experts of OICA as input to the IWG ITS/AD

01/26: Prototyping. Prototypes. Why? Answer Questions. Why? Determine Schedule. Speed (to Write) Why? Reduce Risk. Dr.

Hazard Training Guide

MyCricket User Manual

Apple Device Instruction Guide- High School Game Center (HSGC) Football Statware

ACI_Release_Notes.txt VERSION Fixed Tank info for ELITE in Dive section 2. Fixed USB port initializing for old DC VERSION

INTRODUCTION TO SIGNAL TIMING & TRAFFIC CONTROL

Quick Guide. SGX-CA500 Cycle Computer SGY-PM Series Power Meters

Touch Screen Guide. OG-1500 and OG Part # T011

Process VOC from Another State

Walk This Way. Red Colour Group- Intermediate

HOW TO USE THE URBI APP. A brief guide to using the urbi app

This Manual Part recommends functional/operating guidelines for control of automatic grade crossing warning systems. Draft

IDeA Competition Report. Electronic Swimming Coach (ESC) for. Athletes who are Visually Impaired

User Help. Fabasoft Scrum

Golf Genius Software

GN21 Frequently Asked Questions For Golfers

PPG Pre-Print Card & Auto Teaming

DATAMASK HUD. Water or Push Button Modified Haldanean / DSAT (Diving Science and Technology) Database Each Level provides No.

Weet-Bix MyCricket User Manual

SIDRA INTERSECTION 6.1 UPDATE HISTORY

Long Red, Short Green, I Got Skipped, and Why Do I Always Have To Stop Who Runs These Signals and How Do I Get Ahold Of Them?

Diver-Office. Getting Started Guide. 2007, Schlumberger Water Services

MoLE Gas Laws Activities

SwimNumber App. Build Custom Smart Workouts Control the Wave Propulsion TM System Achieve Health and Fitness Goals INSTRUCTION MANUAL

User Guide. Version Mindjet

Hockomock Summer Baseball League. Score Entry and Team Maintenance June 2018 (UPDATED: June 28 th, 2018) Matt Porro Hockomock Summer League Webmaster

TRAVEL PLAN: CENTRAL EUROPEAN UNIVERSITY CAMPUS REDEVELOPMENT PROJECT TRAVEL PLAN. Central European University Campus Redevelopment Project.

Click on the Sequential Push Tool button you will then see the Sequential Push Control Panel.

CONTENTS. Welcome to Season Setup in Play Football Setting Up Our Details Setting up Age Groups... 9

Sanctioning Events with USA Triathlon

ICD-10-CM IN VERSION 10

Integrate Riverbed SteelHead. EventTracker v8.x and above

How to Download a Red App

BUBBLER CONTROL SYSTEM

BUILDING THE BOILERMAKERS BIKING INFRASTRUCTURE

Swing Labs Training Guide

Designing for the Visually Impaired

Hazard Reporting Training Guide

ARCCOS 360 NEW USER GUIDE

Perth College Netball Academy. Anne and Kerrilee. Team Commitment. 5 May 2016

Dockless Cycle Share

Scenarios. The following slides will show existing pictures that deny access, followed by a retrofitted picture that provides access.

GNX 120/130. Owner s Manual

Maestro 3 rd Party Golf User Guide

Robot Soccer Challenge

National Bicycle and Pedestrian Documentation Project Conducting Counts

Chapter 6 Handicapping

ROTAX GLOBAL APP GUIDE. (revised ) GRAND FINALS EDITION

WATER CONTROL SYSTEM QUICK START

Inventory User Guide

OCL Fall 2013 Coaches Meeting. Ken McMahon Natalie Stellini

Synchro Studio 8. Overview. By Ioannis Psarros

Watertown Complete Streets Prioritization Plan. Public Meeting #1 December 14, 2017

Zoll AED Pro with CPR Stat-Padz & audio recording

Helium: A Data Driven User Tool for SAR Analysis. May 17 th 2011 Karen Worsfold

ONTARIO REGULATION 239/02 MUNICIPAL ACT MINIMUM MAINTENANCE STANDARDS FOR MUNICIPAL HIGHWAYS

GSSC Academy Registration Instructions

User Manual. Heads-Up Display (HUD) DiveCAN. Mechanical Button Version

GolfLogix: Golf GPS. User Guide for: iphone 3G & 3GS. Version 1.0. Software Release 1.0

Version 3.1.0: New Features/Improvements: Improved Bluetooth connection on Windows 10

Modeling Traffic Patterns using Java

Circuit Lap Timer. The app has an Apple Watch interface for ios9+ and Watch OS2.0+. QuickStart Guide

Indiana Traffic Signal Hi Resolution Data Logger Enumerations

Gas Pressure and Volume Relationships *

City and County of San Francisco APS Safety & Access Tool. Cover Sheet. Total score = crosswalk worksheet score + intersection worksheet score

Sofort Banking. How to configure your Sofort and Ingenico epayments account. Copyright 2017 Ingenico epayments

INSTRUCTIONS FOR ENTERING SCHEDULES THROUGH THE NCAA STATISTICS SITE AND WEBSITE PROVIDERS

MoLE Gas Laws Activities

Guide to Using I CSA TechScore

Creating Your Events on the Lightseekers Website

Mac Software Manual for FITstep Pro Version 2

Meter Data Distribution User Manual

There are three types of station hunting in IPedge/VIPedge:

1/6 CAL.YM88 1/5 SECOND CHRONOGRAPH WITH COUNTDOWN TIMER. Instructions. Features 24-hour, Hour, Minute and Small second hands.

Niantic Center Elementary School

The examples below are a starting point, and some fine tuning may be required.

Steltronic StelPad User Guide

Wireless Groundwater & Surface Water Data Transmission Maximize data quality Reduce operating costs Near real-time insight

Designing for Individuals who are visually impaired or blind

Armfield Distillation Column Operation Guidelines

Transcription:

Section 8: Model-View-Controller Slides by Alex Mariakakis with material from Krysta Yousoufian and Kellen Donohue

Agenda MVC MVC example 1: traffic light MVC example 2: registration HW8 info

MVC The classic design pattern Used for data-driven user applications Such apps juggle several tasks: o Loading and storing the data getting it in/out of storage on request o Constructing the user interface what the user sees o Interpreting user actions deciding whether to modify the UI or data These tasks are largely independent of each other Model, view, and controller each get one task

Model talks to data source to retrieve and store data Which database table is the requested data stored in? What SQL query will get me the data I need?

View asks model for data and presents it in a user-friendly format Would this text look better blue or red? In the bottom corner or front and center? Should these items go in a dropdown list or radio buttons?

Controller listens for the user to change data or state in the UI, notifying the model or view accordingly The user just clicked the hide details button. I better tell the view. The user just changed the event details. I better let the model know to update the data.

Communication Flow Model View Controller What do you think are the benefits of MVC?

Benefits of MVC Organization of code o Maintainable, easy to find what you need Ease of development o Build and test components independently Flexibility o Swap out views for different presentations of the same data (ex: calendar daily, weekly, or monthly view) o Swap out models to change data storage without affecting user

MVC Example Traffic Signal Regulate valid traffic movements o Don t let cars run into each other Detect cars waiting to enter intersection Traffic lights to direct car traffic Manual override for particular lights o Automatic green for fire trucks Detect pedestrians waiting to cross Pedestrian signals to direct pedestrians External timer which triggers changes at set interval

Traffic Signal MVC Component Model View Controller Regulate valid traffic movements Detect cars waiting to enter intersection Traffic lights to direct car traffic Manual override for particular lights Detect pedestrians waiting to cross Pedestrian signals to direct pedestrians External timer which triggers changes at set interval

Traffic Signal MVC Component Model View Controller Regulate valid traffic movements Detect cars waiting to enter intersection Traffic lights to direct car traffic Manual override for particular lights Detect pedestrians waiting to cross Pedestrian signals to direct pedestrians External timer which triggers changes at set interval

Traffic Signal MVC Component Model View Controller Regulate valid traffic movements Detect cars waiting to enter intersection Traffic lights to direct car traffic Manual override for particular lights Detect pedestrians waiting to cross Pedestrian signals to direct pedestrians External timer which triggers changes at set interval

Traffic Signal MVC Component Model View Controller Regulate valid traffic movements Detect cars waiting to enter intersection Traffic lights to direct car traffic Manual override for particular lights Detect pedestrians waiting to cross Pedestrian signals to direct pedestrians External timer which triggers changes at set interval

Traffic Signal MVC Component Model View Controller Regulate valid traffic movements Detect cars waiting to enter intersection Traffic lights to direct car traffic Manual override for particular lights Detect pedestrians waiting to cross Pedestrian signals to direct pedestrians External timer which triggers changes at set interval

Traffic Signal MVC Component Model View Controller Regulate valid traffic movements Detect cars waiting to enter intersection Traffic lights to direct car traffic Manual override for particular lights Detect pedestrians waiting to cross Pedestrian signals to direct pedestrians External timer which triggers changes at set interval

Traffic Signal MVC Component Model View Controller Regulate valid traffic movements Detect cars waiting to enter intersection Traffic lights to direct car traffic Manual override for particular lights Detect pedestrians waiting to cross Pedestrian signals to direct pedestrians External timer which triggers changes at set interval

Traffic Signal MVC Component Model View Controller Regulate valid traffic movements Detect cars waiting to enter intersection Traffic lights to direct car traffic Manual override for particular lights Detect pedestrians waiting to cross Pedestrian signals to direct pedestrians External timer which triggers changes at set interval

Traffic Signal Model Stores current state of traffic flow o Knows current direction of traffic o Capable of skipping a light cycle Stores whether there are cars and/or pedestrians waiting Example o TrafficModel

Traffic Signal Views Conveys information to cars and pedestrians in a specific direction Examples o CarLight traffic light o PedestrianLight pedestrian light

Traffic Signal Controller Aware of model s current direction Triggers methods to notify model that state should change Examples o PedestrianButton notifies TrafficModel that there is a pedestrian waiting o CarDetector notifies TrafficModel that there is a car waiting o LightSwitch enables or disables the light o Timer regulates time in some way, possibly to skip cycles

MVC Example Registration Registration system with web interface Advisors create classes, set space, time, restrictions Professors can see who s signed up for their class Students can see available classes and sign up for classes Administrators can place holds on student registration Professors can be notified when a student drops Students can be notified when a spot is available in a class they want

Registration Would you use push or pull? What would change for interaction with an API or mobile app? If advisors can see what students are registered for and change their registration, what changes?

HW8 Overview Apply your generic graph & Dijkstra s to campus map data Given a list of buildings and walking paths Produce routes from one building to another on the walking paths o Distance in feet, compass directions Command-line interface now o GUI in HW9

HW8 Data Format List of buildings (abbreviation, name, loc in pixels) BAG Bagley Hall (East Entrance) 1914.5103,1708.8816 BGR By George 1671.5499,1258.4333 List of paths (endpoint 1, endpoint 2, dist in feet) 1903.7201,1952.4322 1906.1864,1939.0633: 26.583482327919597 1897.9472,1960.0194: 20.597253035175832 1915.7143,1956.5: 26.68364745009741 2337.0143,806.8278 2346.3446,817.55768: 29.685363221542797 2321.6193,788.16714: 49.5110360968527 2316.4876,813.59229: 44.65826043418031 (0,0) is in the upper left

MVC in HW8 Model stores graph, performs Dijkstra s View shows results to users in text format Controller takes user commands and uses view to show results View and Controller will change in HW9, but Model will stay the same