Design Patterns Model – View – Controller. Copyright © 2001 DeLorme 28 November 2001 History ► A framework pattern for reusable applications. ► Depends.

Slides:



Advertisements
Similar presentations
 Recent researches show that predicative programming can be used to specify OO concepts including classes, objects, interfaces, methods, single and multiple.
Advertisements

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.
Design Patterns 2 Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Object-Oriented Analysis and Design
Application Architectures Vijayan Sugumaran Department of DIS Oakland University.
PRESENTED BY SANGEETA MEHTA EECS810 UNIVERSITY OF KANSAS OCTOBER 2008 Design Patterns.
N-Tier Architecture.
Dependency Injection and Model-View-Controller. Overview Inversion of Control Model-View-Controller.
1 Design Patterns for Object-Oriented Programming.
Chapter 13 Starting Design: Logical Architecture and UML Package Diagrams.
MVC pattern and implementation in java
MVC and MVP. References enter.html enter.html
Observer Design Pattern Source: Design Patterns – Elements of Reusable Object- Oriented Software; Gamma, et. al.
CSC 313 – Advanced Programming Topics. Observer Pattern Intent  Efficiently perform 1-to-many communication  Easy to respond dynamically when event(s)
Design Patterns Lecture III. What Is A Pattern? Current use comes from the work of the architect Christopher Alexander Alexander studied ways to improve.
Slide 1 Physical Architecture Layer Design Chapter 13.
Chapter 19 Designing the GUI front-end: the Model-View-Controller pattern.
Behavioral Pattern: Observer C h a p t e r 5 – P a g e 186 A large monolithic design does not scale well as additional graphical and monitoring requirements.
COMP 6471 Software Design Methodologies Winter 2006 Dr Greg Butler
CS 350 – Software Design The Observer Pattern – Chapter 18 Let’s expand the case study to include new features: Sending a welcome letter to new customers.
Oct R McFadyen1 Facade P Problem: There are a set of classes, a subsystem, that you need to interact with for some purpose, but you don’t.
Model View Controller (MVC) Bigger than a Pattern: It’s an Architecture Rick Mercer with help from many others 1.
CSC 313 – Advanced Programming Topics. Observer Pattern in Java  Java ♥ Observer Pattern & uses everywhere  Find pattern in JButton & ActionListener.
Developing MVC based AJAX applications Kapil Mohan Rich Internet Application Developer, Uzanto Consulting A talk by.
Chapter 18 The Observer Pattern Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 13. Review Shared Data Software Architectures – Black board Style architecture.
Behavioural Design Patterns Quote du jour: ECE450S – Software Engineering II I have not failed. I've just found 10,000 ways that won't work. - Thomas Edison.
Model View Controller (MVC) Bigger than a Pattern: It’s an Architecture Rick Mercer with help from many of others 1.
OBSERVER DESIGN PATTERN. Behavioral Patterns  Behavioral patterns are those patterns that are most specifically concerned with communication between.
Manali Joshi1 The Observer Design Pattern Presented By: Manali Joshi.
Behavioral Patterns1 Nour El Kadri SEG 3202 Software Design and Architecture Notes based on U of T Design Patterns class.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 31. Review Creational Design Patterns – Singleton Pattern – Builder Pattern.
Concordia University Department of Computer Science and Software Engineering Click to edit Master title style ADVANCED PROGRAMMING PRACTICES Model View.
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
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.
L10: Model-View-Controller General application structure. User Interface: Role, Requirements, Problems Design patterns: Model – View – Controller, Observer/Observable.
The Observer Pattern (Behavioral) ©SoftMoore ConsultingSlide 1.
Observer / Observable COMP 401 Fall 2014 Lecture 14 10/7/2014.
Ted Faison - GSAW Indefinitely Evolvable Architectures: Event-Based Systems Ted Faison Faison Computing Inc.
Model View ViewModel Architecture. MVVM Architecture components.
Observer Pattern Keeping An Eye on Things Need to introduce observer pattern formally first, include book definition & design principle Keeping An Eye.
OBSERVER PATTERN OBSERVER PATTERN Presented By Presented By Ajeet Tripathi ISE
The Observer Design Pattern Author :Erich Gamma, et al. Source :Elements of Reusable Object-Oriented Software Speaker : Chiao-Ping Chang Advisor : Ku-Yaw.
High degree of user interaction Interactive Systems: Model View Controller Presentation-abstraction-control.
February 23, 2009Observer Pattern, OOA&D, Rubal Gupta, CSPP, Winter ‘09 Observer Pattern Defines a “one-to-many” dependency between objects so that when.
Presented by Alexey Vedishchev Developing Web-applications with Grails framework American University of Nigeria, 2016 Intro To MVC Architecture.
MODEL VIEW CONTROLLER PATTERN. Model View Controller MVC is a time tested method of separating the user interface of an application from its Domain Logic.
J2EE Platform Overview (Application Architecture)
Behavioral Patterns Algorithms and the assignment of responsibilities among objects Describe not just patterns of objects or classes but also the patterns.
Observer Pattern Context:
Design Patterns Source: “Design Patterns”, Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides And Created.
N-Tier Architecture.
Observer Design Pattern
Observer Design Pattern
Observer Design Pattern
Architectural Patterns for Interactive Software
Design Patterns Model – View – Controller
Chapter 13 Logical Architecture.
Design Patterns - A few examples
CS102 – Bilkent University
Model-View-Controller Patterns and Frameworks
Model-View-Controller (MVC) Pattern
Observer Pattern 1.
Starting Design: Logical Architecture and UML Package Diagrams
Chapter 13 Logical Architecture.
Advanced ProgramMING Practices
8. Observer Pattern SE2811 Software Component Design
Advanced ProgramMING Practices
Presentation transcript:

Design Patterns Model – View – Controller

Copyright © 2001 DeLorme 28 November 2001 History ► A framework pattern for reusable applications. ► Depends on the Observer pattern. ► First developed by Xerox PARC for Smalltalk-80. ► Used by the Application Kit system in NeXTstep. ► Used by the Cocoa APIs for Apple’s OS X. ► Recommended structural framework pattern in J2EE. ► I have used this pattern for nearly ten years.

Copyright © 2001 DeLorme 28 November 2001 Observer Pattern ► Defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. ► Used to decouple the subject from the observer, since the subject needs little information to notify the observer. ► Can result in excessive notifications.

Copyright © 2001 DeLorme 28 November 2001 Observer Class Diagram Observable +addObserver(Observer) +deleteObserver(Observer) +notifyObservers(Object) #hasChanged() : boolean #setChanged() Observer +update(Observable, Object) AccountView +update(Observable, Object) BankAccount +widthdraw(double) : long +deposit(double) : long +getBalance() : double SummaryView +update(Observable, Object)

Copyright © 2001 DeLorme 28 November 2001 Transactions Happen! ControllerBankAccountAccountViewSummaryView deposit() setChanged() notifyObservers() update() getBalance()

Copyright © 2001 DeLorme 28 November 2001 Observer Rocks! ► The Observer pattern allowed the BankAccount class to notify multiple views without minimal information. ► Observers can register themselves with their Subjects. No strings attached! ► Transactions would cause this design to collapse under spurious notifications!

Copyright © 2001 DeLorme 28 November 2001 Architecture Diagram View model representation Model business logic Controller user interaction UpdateEvent User Actions Change View SetState Get State

Copyright © 2001 DeLorme 28 November 2001 Advantages ► Separation between the data layer and the interface is the key:  The view is easily replaced or expanded.  Model data changes are reflected in all interfaces because all views are Observers.  Better scalability since UI and application logic are separated.  Distribution over a network is greatly simplified.

Copyright © 2001 DeLorme 28 November 2001 Problems ► Problems of translation:  Business logic bleeds into the Controller.  Observer pattern is non-obvious for EJBs. See EJBObserver by Greg Comeau. ► Problems of the pattern:  Excessive coupling between the Model and View and the Model and Controller.  Frozen interfaces are hard to manage!