Introduction to the MVVM Pattern

Slides:



Advertisements
Similar presentations
MVVM Overview Frank Shoemaker MindCrafted Systems
Advertisements

Expression Blend 4 – deep dive
Silverlight is dead! Long live MVVM!
Developing HTML5 Application using MVVM pattern Pekka Ylenius.
USING THE MODEL-VIEW- VIEWMODEL PATTERN Laurent Bugnion Director, User Experience Integration IdentityMine
Knockoutjs and JQuery The One-Two Punch for Richer MVC 4 Applications Connecticut.NET Developers Group November 13, 2012.
An Introduction to the Model-View-ViewModel Pattern Srsly? Another MV* Pattern? Srsly? Another MV* Pattern?
Or How I Learned to Stop Worrying and Love the Binding Bryan Anderson.
An Introduction To Silverlight Gergely Orosz
WPF MVVM Training Michael Sync (Silverlight MVP).
Real world Windows Phone development Igor
Building Silverlight Applications Using the MVVM pattern An Introduction by Peter Messenger Senior Developer – Qmastor
Shailen Sukul Senior Solutions Architect EMC BSc | Mct | Mcpd (.Net 2/3.5) | Mcts (Sharepoint (MOSS/WSS), Biztalk, Web, Win, Dist Apps) | Mcsd.NET | Mcsd.
Structure of a web application1 Dr Jim Briggs. MVC Structure of a web application2.

MVC pattern and implementation in java
MVC and MVP. References enter.html enter.html
Model View Controller (MVC) Rick Mercer with a wide variety of others 1.
Todd Snyder Development Team Lead Infragistics Experience Design Group.
Microsoft Confidential ASP.NET Broadest reach Most mature dev platform Silverlight Broad reach Rich, Interactive UI WPF Richest, Interactive UI.
Reactive Extensions Ye olde introduction and walk-through, with plenty o’ code.
Mid-term Presentation Validation of Architecture Rules & Design Patterns 25 th May Shravan Shetty &Vinod J Menezes Supervised by, Prof. Dr. M. v. d. Brand.
Architectural Patterns Support Lecture. Software Architecture l Architecture is OVERLOADED System architecture Application architecture l Architecture.
Nikhil Kothari Software Architect Microsoft Corporation Session Code: WUX312.
Windows 10 UWP MVVM In Depth
Overview of the MVVM pattern for Silverlight and WPF.
Model View ViewModel Architecture. MVVM Architecture components.
MVVM Pattern Mahender Senior Software Engineer United Health Group.
Windows 8 apps and the MVVM pattern SILVERLIGHTSHOW.NET WEBINARS SERIES GILL CLEEREN, October 16 th
© Copyright SELA software & Education Labs Ltd Baruch Hirsch St.Bnei Brak Israel
Programming with MVVM Miguel A. Castro Architect -
The cutting edge event for ITPros and Devs December 7-8, 2013 Athens, Greece Fix it once use it everywhere Elias Markelis MCT, Windows Phone Enthusiast.
Presented by Alexey Vedishchev Developing Web-applications with Grails framework American University of Nigeria, 2016 Intro To MVC Architecture.
Model View Presenter Design Pattern Jay Smith PMO Architect and Evangelist Tyson Foods, Inc.
Adam Schultz MVVM and WPF. MVVM Model, View, ViewModel A software architecture designed to separate out User Interface design, Business Logic, and Data.
In Windows 8 Store Applications
Real world Windows Phone development
Design Patterns Source: “Design Patterns”, Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides And Created.
Software Design Refinement Using Design Patterns
Support for the Development of Interactive Systems
MVVM Made Simple with Prism
Structure of a web application
Better Unit Tests through Design Patterns: Repository, Adapter, Mocks, and more… Benjamin
Software Architecture & Difference from Design
Introduction to Event-Driven Programming
Chapter 10 Design Patterns.
Building Custom Workflows
MVC and Design Patterns
Build Windows 10 UWP MVVM Apps with Prism
Instructor: Dr. Hany H. Ammar
It’s a Knockout! MVVM Style Web Development
Introduction to Operating System (OS)
BTS530: Major Project Planning and Design
Miguel A. Castro Architect IDesign
Lesson 2: Multi-Screen Apps
Model-View-Controller
WPF AKEEL AHMED.
Model-View-Controller Patterns and Frameworks
An introduction to MVVM using WPF NISCHAL S
Tech Ed North America /1/2018 4:27 PM Required Slide
MBI 630: Week 11 Interface Design
Introduction UI designer stands for User Interface designer. UI designing is a type of process that is used for making interfaces in the software or the.
Event loops 17-Jan-19.
Model-view-controller
XAML Deep Dive for Windows & Windows Phone Apps Jump Start
Architecting Silverlight Applications with MVVM
Model, View, Controller design pattern
Web Client Side Technologies Raneem Qaddoura
Tech Ed North America /6/2019 2:07 PM Required Slide
An Introduction to the Model-View-ViewModel Pattern
Presentation transcript:

Introduction to the MVVM Pattern MVVM and Silverlight Reddy Kadasani Project Manager Tallan, Inc. Proprietary and Confidential. Copyright 2010. 11/15/2018

Stands for Model-View-ViewModel It is a Software Design Pattern What is MVVM? Stands for Model-View-ViewModel It is a Software Design Pattern Silverlight and WPF are Built on MVVM Guis consist of widgets that contain the state of the UI screen. Leaving the state of the UI in the widgets makes it harder to get to this state and manipulate it. . Tallan, Inc. Proprietary and Confidential. Copyright 2010. 11/15/2018

Model –View-Controller Tallan, Inc. Proprietary and Confidential. Copyright 2010. 11/15/2018

Presentation Model Pattern (MVVM) State and Behavior of the “Presentation” Moving the State outside the Widgets or Controls a.k.a Application Model Model View Presentation (ViewModel) The Presentation Model pulls the state and behavior of the view out into the model class that is part of the presentation. The PM coordinates with the domain layer and provides an interface to the view. This minimizes the decisions that the view needs to make. The view either stores all of its state in the Presentation Model or synchronizes its state with the Presentation Model frequently. The PM may interact with several domain objects, but the PM is not a GUI friendly façade to a specific domain object. The PM is actually an abstract of the view that is not dependent on a specific GUI framework. Data Binding State and Behavior Commands Events Tallan, Inc. Proprietary and Confidential. Copyright 2010. 11/15/2018

Presentation Model Pattern (MVVM) A View should require only one Presentation Model Several Views can utilize the same Presentation Model View View Presentation (ViewModel) State and Behavior Tallan, Inc. Proprietary and Confidential. Copyright 2010. 11/15/2018

Synchronization Between the Presentation Model and View Key Points to Consider Synchronization Between the Presentation Model and View Repetitive Code Where to put the Synch Code? Should the View Reference the PM? Should the PM Reference the View? Testability Maintainability Frameworks PRISM MVVM Light Toolkit A Presentation Model that references a view generally maintains the syncronization code in the Presentation Model. The resulting view is very dumb. The view contains setters for any state that is dynamic and raises events in response to user actions. The views implement interfaces allowing for easy stubbing when testing the Presentation Model. The Presentation Model will observe the view and respond to events by changing any appropriate state and reloading the entire view. As a result the syncronization code can be easily tested without needing the actual UI class. A Presentation Model that is referenced by a view generally maintains the syncronication code in the view. Because the syncronization code is generally easy to write and easy to spot errors it is recommended that the testing occur on the Presentation Model and not the View. If you are compelled to write tests for the view this should be a clue that the view contains code that should belong in the Presentation Model. If you prefer to test the syncronization, a Presentation Model that references a view implementation is recommended. Tallan, Inc. Proprietary and Confidential. Copyright 2010. 11/15/2018

How does it work in Silverlight? Dependency Properties INotifyPropertyChanged UI Element (Dependency Property) (CLR Object) (Property) Binding Object Tallan, Inc. Proprietary and Confidential. Copyright 2010. 11/15/2018

How does it work in Silverlight? Data Template Data Binding Notifying of Change Relay Command Messages (Events) Tallan, Inc. Proprietary and Confidential. Copyright 2010. 11/15/2018

DEMO DEMO Create a Simple Silverlight Application that uses MVVM to display a list of Movies Tallan, Inc. Proprietary and Confidential. Copyright 2010. 11/15/2018

References Presentation Model – Martin Fowler (http://martinfowler.com/eaaDev/PresentationMod el.html) Passive View – Martin Fowler (http://martinfowler.com/eaaDev/PassiveScreen.ht ml) Silverlight and MVVM Silverlight.net WPF Apps with MVVM (http://msdn.microsoft.com/en- us/magazine/dd419663.aspx) MVVM Toolkit (http://www.galasoft.ch/mvvm/getstarted/) Tallan, Inc. Proprietary and Confidential. Copyright 2010. 11/15/2018