This deck (and sample code) was used for several presentations of this talk: NH Code Camp (28-Feb-2009) Beantown.NET User Group (05-Mar-2009) Boston Code.

Slides:



Advertisements
Similar presentations
Expression Blend 4 – deep dive
Advertisements

Silverlight is dead! Long live MVVM!
MVVM Basics with Caliburn.Micro Presented by Stefan Nuxoll, Lithium PC.
Fabian Vilers Hands on ASP.NET MVC.
Prism is 100% Resume Compliant! Trendy design patterns! Test-Driven Development Loosely Coupled Blend-able UIs Interface-based Programming Dependency Injection.
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
WPF MVVM Training Michael Sync (Silverlight MVP).
Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC308.
An introduction to. Introductions  I’m Rob Fonseca-Ensor  A Solution Architect at Infusion  I run the Canary Wharf.NET User Group  I blog at
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.
Joe xamlcoder.com/blog Silverlight / WPF Consultant.
Composite Application Guidance Prism 2 A Rainbow of Possibilities.
Building Composite Applications with WPF Tomer Shamam Smart Client Manager Sela Group
Best and Worst Practices Building RIA from Adobe and Microsoft.
Using Microsoft SharePoint to Develop Workflow and Business Process Automation Ted Perrotte National Practice Manager, Quilogy, Microsoft Office SharePoint.
By Bob Bunson  Simulation of software development project  Fictitious system from Concept to Code  Oriented around the.
Developing for the Microsoft Office System Jay Schmelzer Group Program Manager – Visual Studio.
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
Chapter 13 Starting Design: Logical Architecture and UML Package Diagrams.
MVC pattern and implementation in java
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
@benday #vslive Better Unit Tests through Design Patterns: Repository, Adapter, Mocks, and more… Benjamin
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. WEB.
MVC and MVP. References enter.html enter.html
Todd Snyder Development Team Lead Infragistics Experience Design Group.
An Introduction to Software Architecture
Virtual techdays INDIA │ Nov 2010 Developing Office Biz Application using WPF on Windows 7 Sarang Datye │ Sr. Consultant, Microsoft Sridhar Poduri.
Todd Kitta  Covenant Technology Partners  Professional Windows Workflow Foundation.
Building an Offline Smart Client using Domain-Driven Design Principles Tim McCarthy.
Rudi Grobler Session Code: WUX205.
ICINETIC Experts in.NET technologies and architectures.
Getting Started with Caliburn.Micro and Windows Phone 7 Gary Ewan Park Twitter: Blog:
Microsoft SharePoint Server 2010 for the Microsoft ASP.NET Developer Yaroslav Pentsarskyy
Composite User Interface Application Block Peter Provost Development Lead – patterns & practices
FIRST FLOOR SOFTWARE Experts in XAML. Visual Studio Industry Partner FIRST FLOOR SOFTWARE NEXT STEPS Contact us at: First.
ICINETIC Experts in.NET technologies and architectures.
Windows 8 for Existing.NET Developers Tim Heuer Program Manager Windows Developer Experience Microsoft Corporation.
Building State of the art presentation tiers Nauzad Kapadia
Nikhil Kothari Software Architect Microsoft Corporation Session Code: WUX312.
MVC WITH CODEIGNITER Presented By Bhanu Priya.
Brennon Williams C.T.O. Splendid Expression Blend Design. Develop.
1 Beyond Silverlight with WPF Clients ( WPF : Windows Presentation Foundation ) Mike Taulty Developer & Platform Group Microsoft Ltd
Modern Development Technologies in SharePoint SHAREPOINT SATURDAY OMAHA APRIL, 2016.
Programming with MVVM Miguel A. Castro Architect -
Vladimir Milev New Venture Software Sharing Code between WPF and Universal Apps.
Benjamin Unit Testing & Test-Driven Development for Mere Mortals.
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.
Enterprise Library 3.0 Memi Lavi Solution Architect Microsoft Consulting Services Guy Burstein Senior Consultant Advantech – Microsoft Division.
GrapeCity Build Experiences with Enterprise-level Tools and Solutions
Introducing the Microsoft® .NET Framework
Real world Windows Phone development
MVVM Made Simple with Prism
Better Unit Tests through Design Patterns: Repository, Adapter, Mocks, and more… Benjamin
9/4/2018 5:28 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Build Windows 10 UWP MVVM Apps with Prism
Enterprise Library Overview
WPF vs Silverlight.
Introduction to the MVVM Pattern
Developer Patterns to Integrate Silverlight 4.0 with SharePoint 2010
An Introduction to Software Architecture
Jordan Knight Solution Architect - Xamling
Build /23/2019 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
From Development to Production: Optimizing for Continuous Delivery
Office 365 Development July 2014.
Mark Quirk Head of Technology Developer & Platform Group
Tech Ed North America /6/2019 2:07 PM Required Slide
Running C# in the browser
An Introduction to the Model-View-ViewModel Pattern
Presentation transcript:

This deck (and sample code) was used for several presentations of this talk: NH Code Camp (28-Feb-2009) Beantown.NET User Group (05-Mar-2009) Boston Code Camp 11 (28-Mar-2009)

Prism is 100% Resume Compliant! Fancy design patterns like Model-View-ViewModel Test-Driven Development (TDD) Loosely Coupled Separation of Concerns (SoC) Interface-based Programming Dependency Injection (DI) Inversion of Control (IoC) Containers Code-Behind minimalist Modular, Composite Application Distributed Agile Team Reverses baldness Fluent Interfaces Multi-Targeting Silverlight and WPF Routed Commands & Routed Events High Performance Dev Increases your IQ 42 points Data Binding Architect (not Astronaut)

Introduction to Prism Bill Wilder Building Silverlight and WPF apps with Composite Applications Guidance and Composite Application Library

What is this talk about? Targeting Silverlight and/or WPF – Managing complexity well – Best practices for Testability and design patterns Focus (mostly) around UI concerns – XAML, Code-behinds, Data Binding Doing all of the above Using Prism – Runtime Library + Guidance + Project Linker

Assumptions: You have heard of… Windows Presentation Foundation (WPF), Silverlight, XAML Unit Testing (nUnit, …), TDD Dependency Injection (DI), Inversion of Control (IoC), Loose coupling UI Design Patterns (MVC, MVP, …) Where are YOU coming from?

Goals of this Talk Appreciate value of Prism for SL and WPF Demonstrate a few key Prism concepts Side effects: A little WPF, Silverlight; discuss a couple of Design Patterns / Anti-Patterns Rules of engagement: Ask questions any time

Terminology Prism  code name (which I will call it) Prism v2  talking about 2 nd release Composite Application Guidance for WPF and Silverlight  official name of whole package Composite Application Library for WPF and Silverlight  runtime support included – sometimes called “CAL”

What’s the problem? US businesses annually spend ~ $250 billion on software dev across approx 175,000 projects Only 16 percent of these projects finish on schedule and within budget Another 31 percent are cancelled, mainly due to quality problems Another 53 percent exceed their budgets by an average of 189 percent Projects reaching completion deliver an average of only 42 percent of the originally planned features [Credit: Jack Greenfield, Microsoft] Okay, so this stuff ain’t easy

Industry Response

Where did Prism come from? P&P = Patterns & Practices Group microsoft.com/patterns

Product Groups Long cycle times Strategic Very large teams Cost money Fully Supported Rapid cycle times Small, focused agile teams – Partner with community Ship tactical solutions now – Code and Guidance Free, Open Source More latitude, less legacy P&P Group EntLib, Unity, Arch Guide CAB, Prism v1, Prism v2 Windows, Office, Exchange, Visual Studio,.NET, Sharepoint, Zune,...

Demo Stock Trader RI (RI = Reference Implementation)

Prism Key Concepts Eye Chart [Source CAL docs]

Shell, Regions, Views Shell is main window for app Shell defines (visual) Regions Regions control where UI will appear – flexible Views are displayed within Regions WPF/Silverlight design, code, tooling still applies – Prism just makes it better

Views and Modules Modules are DLLs (Projects) – Nice unit of work You can decide when/whether to load Modules can be configured to load code, XML, or XAML Modules can be downloaded (over http) – Can write your own loader rules Modules have Views (usually)

Events.NET events – Tight coupling (references in both directions) WPF events – Looser coupling, (generally) limited to same visual tree Composite events – Looserer coupling; not limited to same visual tree More: Force to UI thread; event filtering [Related to Commanding]

Prism “Conventions+” Bootstrapper Shell One module per DLL M-V-VM pattern Don’t need to follow the conventions… But you’ll be glad you did

Prism is (relatively) Small WPF Prism Silverlight

First Cut At “SaveAsPodcast” App Look at some code…

Why Separate Concerns in UI? Optimizes Developer / Designer interaction – Dev in Visual Studio, Designer in Expression Blend Easier to Test – Now possible to Unit Test (vs. Integration Test) – Simpler problem isolation Reuse opportunity goes way up – Same ViewModel can be reused with UI variations Better organized code is better code – Easier to understand, maintain – SE Principles: SoC, coupling, cohesion, SRP (rendering, mouse & keyboard, disabled, hover)

How to Separate Concerns in UI? Use Code-Behinds reluctantly + M-V-VM M-V-VM  Model-View-ViewModel Pattern Abbreviated as M-V-VM, MVVM Often referred to simply as ViewModel Specialization of Fowler’s Presentation Model pattern where View knows about ViewModel – Prism docs refer to as Presentation Model I will refer to as ViewModel pattern

ViewModel Pattern View Data Binding ViewModelModel Your Glue Supported by WPF / SL Powerful Data Binding glue provided free with both Silverlight and WPF Custom code (boring); Automapper is promising Load external data from web services, etc.

Supported by WPF / SL Code-Behind Pattern (Old Way) View Model Your Other Glue UI “is” the data store for much of the data (e.g., ListBox); logic intertwined Custom code to populate UI Code Behind for each Control Load external data from web services, etc.

Port “SaveAsPodcast” to Prism M-V-VM Modules Eventing Event Filtering

Prism Rough Edges You build it; P&P does not (yet) ship a binary No Prism-specific templates for Visual Studio Cannot unload a Module (MEF?)

When to go Composite? (1/2) You are designing “complex” WPF or Silverlight applications, or… You are building an application that presents information from multiple sources through an integrated user interface, or… You are developing, testing, and deploying modules independently of other modules, or… [Source CAL docs]

When to go Composite? (2/2) Your app will add more views and more functionality over the coming years, or… You must be able to change the app quickly and safely to meet emergent business requirements, or… Your app is being developed by multiple collaborating teams; or… Your app targets both WPF and Silverlight, and you want to maximize code sharing between platforms. [Source CAL docs]

When to NOT go Composite? Your apps do not require any of the above scenarios, or… Your application consists of a few simple screens, or… You are building a prototype or demo, or… Your developers are not familiar with the ideas and practices and do not have the time to learn them. * COMPLEMENTARY * (remember the opening slide) [Source CAL docs]

Wrong reason to choose Prism

Why Prism SoC + SRP + reducing plumbing code + Unit Tests  best way to handle complexity and enable ability to respond rapidly to requirement changes M-V-VM  best way to support the previous item (in SL/WPF) Prism  best way to support the previous item

Official Site -- or --

Watch these spaces “Contrib” – Assorted contributions for Prism (currently v1) Channel 9 for tutorial videos – Infragistics control adapters for – Region Adaptors for Prism (currently v1)

Prism v2 References D=fa07e1ce-ca3f-4b9b-a21b- e3fa10d013dd&DisplayLang=en D=fa07e1ce-ca3f-4b9b-a21b- e3fa10d013dd&DisplayLang=en release-composite-application-guidance-for-wpf-and- silverlight-v2-0-prism.aspx release-composite-application-guidance-for-wpf-and- silverlight-v2-0-prism.aspx released-composite-guidance-for-silverlight-lob.aspx released-composite-guidance-for-silverlight-lob.aspx application-guidance-for-wpf-and-silverlight-v20-prism/ application-guidance-for-wpf-and-silverlight-v20-prism/

Other Resources Josh Smith on MVVM with WPF: us/magazine/dd aspx us/magazine/dd aspx Brian Noyes on Understanding Routed Events and Routed Commands in WPF: us/magazine/cc aspxhttp://msdn.microsoft.com/en- us/magazine/cc aspx WPF Commanding Overview: Martin Fowler’s description of Presentation Model pattern: XAML Guidelines for Creating a Composite UI:

Did I get to this? What would happen if I ran the Synchronous retrieval of the Podcast feed from Silverlight? Show the Prism docs

Silverlight for.NET Challenge #1: not binary compatible with runtimes that run on Windows desktop – But it is source compatible Challenge #2: only a subset of runtime is implemented on Silverlight (subset, security, useful, choose 1, async, cross-domain) – But most of the stuff that “makes sense” is there (subset, security, useful, choose 1, async, cross-domain) Challenge #3: XAML not same as WPF – But is converging on mostly a subset Other miscellaneous differences… Suggestion: Write 1 st in Silverlight, then port to WPF

Questions?

Loose Coupling – How To Architect for general flexibility using Dependency Inversion & code to interfaces Use an IoC container (Unity, Structure Map, Castle Windsor) Unit test using IoC