11. MVC SE2811 Software Component Design

Slides:



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

SE2811 Week 7, Class 2 The Gang of Four and more … Lab Thursday: Quiz SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder.
Presented by Benjamin Kehrer [CSCI 360, CofC, 03/17/08]
OOP Design Patterns Chapters Design Patterns The main idea behind design patterns is to extract the high level interactions between objects and.
Week 8, Class 3: Model-View-Controller Model-View-Controller Why? What? How? Example: Barnyard Simon for the Web Question: Where should we use the command.
Object-Oriented Analysis and Design
A project management tool in Polytechnic University of Tirana (Bachelor thesis) Iva Tarelli Prof. Assoc. Elinda Kajo 14 th Workshop “SEE&RE” Sinaia, Romania,
MVC and MVP. References enter.html enter.html
COMP 6471 Software Design Methodologies Winter 2006 Dr Greg Butler
1 CSC 222: Object-Oriented Programming Spring 2012 netBeans & GUIBuilder  netBeans IDE create/edit/run a project  GUIBuilder JFrame, JButton, JTextField,
Week 6, Class 1 & 2: Decorators Return Exam Questions about lab due tomorrow in class? Threads Locking on null object invokeLater & the squares example.
Model View Controller MVC Web Software Architecture.
Lecture Model View Controller s/w architecture AND general tips on structuring classes.
L10: Model-View-Controller General application structure. User Interface: Role, Requirements, Problems Design patterns: Model – View – Controller, Observer/Observable.
04 - OOD Intro.CSC4071 Software Design ‘Requirements’ defines –The goals the system needs to satisfy. ‘Specification’ defines –The externally-observable.
SE-1021 Software Engineering II Week 9, Class 1 ByteBuffer Tomorrow Get quizzes back from last week… Wednesday Quiz at start of lab 1.
Week 5, Day 2: Decorator Decorators Muddiest Point Tomorrow: Quiz on lab reading: web.msoe.edu/hasker/se2811/labs/5/ SE-2811 Slide design:
Week 6, Day 3 The Gang of Four and more … A new design pattern SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1.
Week 7, Class 1: The Command Pattern (cont.) Get Ready for Poll Everywhere Labs 2 & 3 returned Lab 7 due this evening at 11pm Quiz tomorrow at start of.
Model-View-Controller A Design Pattern SE-2030 Dr. Rob Hasker 1 Based on slides written by Dr. Mark L. Hornick Used with permission.
CS 350 – Software Design The Decorator Pattern – Chapter 17 In this chapter we expand our e-commerce case study and learn how to use the Decorator Pattern.
Week 5, Class 3: Decorators Lab questions? Example: Starbuzz coffee Basic Pattern More examples Design Principles Compare with alternatives SE-2811 Slide.
SE2811 Week 8 – Class 2 Re: Lab due tonight SE-2811 Slide design: Dr. Mark L. Hornick Much Content: Dr. Hornick Most Errors: Dr. Yoder 1.
CS-2852 Data Structures Week 5, Class 3 – Testing and Recursion Queue Implementing finite queues Binary Search Recursion Tomorrow – Quiz, Lab demos, Lab.
Slide design: Dr. Mark L. Hornick
CSC 222: Object-Oriented Programming
Design Patterns Source: “Design Patterns”, Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides And Created.
Introduction to .NET Florin Olariu
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
MVC Architecture, Symfony Framework for PHP Web Apps
Software Design.
Week 2, Day 1: The Factory Method Pattern
SE-2811 Software Component Design
Polling vs. Interrupts CS2852 7/20/2018
Content Management System
Polling vs. Interrupts CS2852 9/18/2018
The Object Oriented Approach to Design
Behavioral and Structural Patterns
3. Object-oriented Design
Model-View-Controller Patterns and Frameworks
Reusability 11/29/2018© 2006 ITT Educational Services Inc.
Decorator Pattern Richard Gesick.
Model-View-Controller (MVC) Pattern
Week 7, Class 1: The Command Pattern (cont.)
Starting Design: Logical Architecture and UML Package Diagrams
Introduction to AppInventor
7. Decorator SE2811 Software Component Design
Design Patterns Lecture part 1.
8. Observer Pattern SE2811 Software Component Design
4: Object-oriented Analysis & Design
Slide design: Dr. Mark L. Hornick
SE2811 Software Component Design Dr. Rob Hasker
Model-view-controller
Week 6, Class 2: Observer Pattern
Polling vs. Interrupts CS2852 4/21/2019
Slide design: Dr. Mark L. Hornick
Week 8, Class 3: Model-View-Controller
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
Week 8, Class 3: Model-View-Controller
SE-1021 Software Engineering II
Slide design: Dr. Mark L. Hornick
11. MVC SE2811 Software Component Design
Slide design: Dr. Mark L. Hornick
16. Visitors SE2811 Software Component Design
SE-1021 Software Engineering II
SE2811 Software Component Design Dr. Rob Hasker
Slide design: Dr. Mark L. Hornick
Presentation transcript:

11. MVC SE2811 Software Component Design Dr. Rob Hasker (based on slides by Dr. Josiah Yoder) 11. MVC

Model-View-Controller SE2811 5/3/2019 Model-View-Controller What is the model? What is the view? What does the controller do? Full agenda: Return Exam Questions about lab due tomorrow in class? Threads: Locking on null object Threads: invokeLater Threads: The squares example Decorator Class Diagram More on Java IO Class diagrams Design Principles in the patterns we’ve seen so far Compare with alternatives Decorator vs. array approach suggested in class Non-decorator array – decorator can be added on without modifying the original hierarchy Decorator has “before-after” and possibly other combinatorial control that would be hard-coded in array [Show “screenshot” of discussion from class? Or just re-type?] Strategy vs. Decorator class diagrams side-by-side Structural difference (inheritance optional in Strategy pattern?) Decorator vs. “Strategy” array Perhaps next: Coding Starbuzz coffee (?) Add real patterns ArrayList – null-checking Java I/O: Students do coding examples http://stackoverflow.com/questions/9358821/should-i-extend-arraylist-to-add-attributes-that-isnt-null Dr. Josiah Yoder

Why MVC? To support the user’s mental model 5/3/2019 Why MVC? To support the user’s mental model Image by a creator/discoverer of MVC http://heim.ifi.uio.no/~trygver/themes/mvc/mvc-index.html Dr. Josiah Yoder

Why focus on models? How does a vacuum cleaner work? What does a repair person need to know? What does an engineer need to know? Software: provides a mental model Should reflect the user’s model User’s model: does not include button logic, scenes, databases

What is MVC? click, drag, type display User Controller View manipulate 5/3/2019 What is MVC? click, drag, type display User Architectural pattern popular for user interface design Controller View manipulate update Model Dr. Josiah Yoder

Game of Life (SE 1021, Winter 2017)

Game of Life (SE 1021, Winter 2017)

What is MVC (2) User display click, drag, type forward events update Controller View manipulate update Model

MVC and Design Patterns From the “Gang of Four”: “MVC decouples views and models by establishing a subscribe/notify protocol between them [and] lets you attach multiple views to a model” What design pattern is this? Answer: Observer

MVC and Design Patterns From the “Gang of Four”: “Another feature of MVC is that views can be nested.” What design pattern is this? 1 view per form: application is a combination of views Alternatively: a view for each panel, develop view for the panel that contains those panels

MVC Model: data, user model View: display the data Largely: domain classes + containers View: display the data May also include handling user actions Often: app contains multiple views Controller: business logic, interface to model May include handling user actions Advantages: Distributed logic Separate messy display code from the domain implementation Supports automated testing of model, business logic Challenges: Not clear what functionality goes where Confusing to novice programmers