SlideShare a Scribd company logo
1 of 51
Architecting WPF Applications Paul Stovell Senior Consultant WPF Technical Specialist Readify
Agenda WPF Overview Inductive vs. Deductive UI Navigation Presentation Patterns Composition Inter-view Communication Dependency Injection Partitioning Leveraging XAML Performance Considerations
WPF Overview
Unified Presentation
Web or Windows? Windows Intranet                 Internet Silverlight Windows Forms Java Java Applets ASP.NET WPF XBAP WPF AJAX
XBAP
XBAP
WPF Releases .NET Framework 3.0 .NET Framework 3.5 .NET Framework 3.5 Service Pack 1 .NET Framework 4.0
Inductive vs. Deductive
Deductive UI
Deductive UI
Inductive UI
Inductive UI
Inductive vs. Deductive Why does it matter? UI composition Patterns Navigation Patterns Service Layer ChangeAddress vs. SaveCustomer
DataGrid
Navigation
Linked List Page 1 Page 2 Page 4 Page 3
Centralized Decisions Navigation Handler Page 1 Page 2 Page 3 Page 4
Presentation Patterns
Presentation Patterns Model-View-ViewModel aka Presentation Model Model-View-Presenter aka Supervising Controller Model-View-Controller
Model View ViewModel Change Address View Model Customer Address Accounts Change Address ViewModel
Model View ViewModel (Wrapped) View Model Change Address View Customer VM Account VM Address VM Change Address ViewModel Model Customer Account Address
Model View Presenter Change Address View Model Customer IChangeAddressView Address Accounts Change Address Presenter
Model View Presenter with VM Change Address View Model Customer Change Address ViewModel IChangeAddressView Address Accounts Change Address Presenter State Behaviour
Model View Controller Controller View 1 Model 1 View 2 Nav Request Model 2 View 3 Model 3
Presentation Patterns Things to consider: Does every view need separated presentation? Does every view need to follow the same pattern? Code Behind isn’t Evil (DataGrids are) MVPoo
UI Composition
Model-based Composition Recent Orders ViewModel Search ViewModel Weather ViewModel Order List Search Weather
UI-based Composition Bottom-Up Order List Top Region 2. Place Navigation Bottom Region 1. Resolve Search Weather
UI-based Composition Top-Down Order List Top Region Bottom Region Search Weather
Inter-View Communication
Inter-View Communication Standard .NET events Search Model Child model raises event Parent model forwards event Results Model Criteria Model
Inter-View Communication Event Aggregator Results Model Criteria Model hub Publish Handle Publish Handle Advert Model Recent Searches Model
Event Aggregator Advantages: Automatic thread switching Weak events Hook for cross-cutting concerns
Dependency Injection
Dependency Injection
Partitioning
Partitioning Splitting partitions: By SKU By feature By team By department
Partitioning Managing partitions: With solutions With projects With assemblies
Partitioning Resolving: Hard-coded Config Discovery
Partitioning Also consider: Deployment and patching Inter-partition dependencies Dev time vs. build time partitioning
Partitioning Remember: assemblies are like water necessary for life… …but too much can kill you!
Leveraging XAML
Abstractions <Grid>    <..>    <Label  Grid.Row="0" Grid.Column="0"         Content="First Name:"         Target="{Binding ElementName=FirstNameTextBox}"        />    <TextBox Grid.Row="0" Grid.Column="1"        Name="FirstNameTextBox"        Text="{Binding Path=FirstName}"        /> </Grid> <Form>     <Field For="{Binding Path=FirstName}" />     <Field For="{Binding Path=LastName}" />     <Field For="{Binding Path=EmailAddress}" /> </Form>
Consistency <TextBlock    Foreground="Red"   Text="Please enter..."   /> <TextBlock    Foreground="{StaticResourceColor.Bad}"   Text="Please enter..."     />
Style Catalogues <TextBox Width="300" .../> <TextBox Width="156" .../> <TextBox Width="215" .../> <TextBox Style="{StaticResourceTextBox.Big}" /> <TextBox Style="{StaticResourceTextBox.Small}" /> <TextBox Style="{StaticResourceTextBox.Medium}" />
Behaviours Consider this: Developers don't write code; they build tools for designers
Performance Considerations
Performance Considerations Retained scene vs. Immediate Mode Virtualization (data and UI) Memory leaks Third party components Performance test from day 1
Q&A Links: http://www.codeplex.com/CompositeWPF http://magellan.codeplex.com http://www.galasoft.ch/mvvm/getstarted/ http://caliburn.codeplex.com Paul Stovell paul@paulstovell.com www.paulstovell.com

More Related Content

What's hot

Sys02 best way to create a share point app
Sys02   best way to create a share point appSys02   best way to create a share point app
Sys02 best way to create a share point app
DotNetCampus
 
Expression studio overview_MVP Kok Chiann
Expression studio overview_MVP Kok ChiannExpression studio overview_MVP Kok Chiann
Expression studio overview_MVP Kok Chiann
Quek Lilian
 

What's hot (19)

WPF
WPFWPF
WPF
 
AN INTRODUCTION TO APACHE FLEX
AN INTRODUCTION TO APACHE FLEXAN INTRODUCTION TO APACHE FLEX
AN INTRODUCTION TO APACHE FLEX
 
Introduction To Silverlight
Introduction To SilverlightIntroduction To Silverlight
Introduction To Silverlight
 
Flex vs HTML5
Flex vs HTML5Flex vs HTML5
Flex vs HTML5
 
Windows Presentation Foundation
Windows Presentation FoundationWindows Presentation Foundation
Windows Presentation Foundation
 
Windows Presentation Foundation
Windows Presentation Foundation  Windows Presentation Foundation
Windows Presentation Foundation
 
Conociendo el ecosistema de Windows Phone 8 y Windows 8
Conociendo el ecosistema de Windows Phone 8 y Windows 8Conociendo el ecosistema de Windows Phone 8 y Windows 8
Conociendo el ecosistema de Windows Phone 8 y Windows 8
 
Apache Flex: Overview
Apache Flex: OverviewApache Flex: Overview
Apache Flex: Overview
 
Open Source examples from Adobe : Oscon kiosk
Open Source examples from Adobe : Oscon kioskOpen Source examples from Adobe : Oscon kiosk
Open Source examples from Adobe : Oscon kiosk
 
Opening the mobile web mozilla and firefox os-chit thiri maung
Opening the mobile web   mozilla and firefox os-chit thiri maungOpening the mobile web   mozilla and firefox os-chit thiri maung
Opening the mobile web mozilla and firefox os-chit thiri maung
 
Sys02 best way to create a share point app
Sys02   best way to create a share point appSys02   best way to create a share point app
Sys02 best way to create a share point app
 
Silverlight 4 @ MSDN Live
Silverlight 4 @ MSDN LiveSilverlight 4 @ MSDN Live
Silverlight 4 @ MSDN Live
 
Getting Started with Flex and PHP
Getting Started with Flex and PHPGetting Started with Flex and PHP
Getting Started with Flex and PHP
 
Flex 4 Overview
Flex 4 OverviewFlex 4 Overview
Flex 4 Overview
 
Adobe flex an overview
Adobe flex  an overviewAdobe flex  an overview
Adobe flex an overview
 
Expression studio overview_MVP Kok Chiann
Expression studio overview_MVP Kok ChiannExpression studio overview_MVP Kok Chiann
Expression studio overview_MVP Kok Chiann
 
Silverlight
SilverlightSilverlight
Silverlight
 
EDMUG Silverlight Talk
EDMUG Silverlight TalkEDMUG Silverlight Talk
EDMUG Silverlight Talk
 
Buzzword, How'd They Build That?
Buzzword, How'd They Build That?Buzzword, How'd They Build That?
Buzzword, How'd They Build That?
 

Similar to Architecting WPF Applications

D22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source FrameworksD22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source Frameworks
Sunil Patil
 
D22 portlet development with open source frameworks
D22 portlet development with open source frameworksD22 portlet development with open source frameworks
D22 portlet development with open source frameworks
Sunil Patil
 
MSDN Unleashed: WPF Demystified
MSDN Unleashed: WPF DemystifiedMSDN Unleashed: WPF Demystified
MSDN Unleashed: WPF Demystified
Dave Bost
 
Application Lifecycle Management with TFS
Application Lifecycle Management with TFSApplication Lifecycle Management with TFS
Application Lifecycle Management with TFS
Mehdi Khalili
 
* DJANGO - The Python Framework - Low Kian Seong, Developer
    * DJANGO - The Python Framework - Low Kian Seong, Developer    * DJANGO - The Python Framework - Low Kian Seong, Developer
* DJANGO - The Python Framework - Low Kian Seong, Developer
Linuxmalaysia Malaysia
 
Maintainable Javascript carsonified
Maintainable Javascript carsonifiedMaintainable Javascript carsonified
Maintainable Javascript carsonified
Christian Heilmann
 
Mvvm pattern
Mvvm patternMvvm pattern
Mvvm pattern
msarangam
 
Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with SilverlightRe-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Frank La Vigne
 

Similar to Architecting WPF Applications (20)

Dot net training bangalore
Dot net training bangaloreDot net training bangalore
Dot net training bangalore
 
D22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source FrameworksD22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source Frameworks
 
D22 portlet development with open source frameworks
D22 portlet development with open source frameworksD22 portlet development with open source frameworks
D22 portlet development with open source frameworks
 
MSDN Unleashed: WPF Demystified
MSDN Unleashed: WPF DemystifiedMSDN Unleashed: WPF Demystified
MSDN Unleashed: WPF Demystified
 
Shine a Light with Prism (the Composite Application Guidance for WPF and Silv...
Shine a Light with Prism (the Composite Application Guidance for WPF and Silv...Shine a Light with Prism (the Composite Application Guidance for WPF and Silv...
Shine a Light with Prism (the Composite Application Guidance for WPF and Silv...
 
Application Lifecycle Management with TFS
Application Lifecycle Management with TFSApplication Lifecycle Management with TFS
Application Lifecycle Management with TFS
 
Get Started with JavaScript Frameworks
Get Started with JavaScript FrameworksGet Started with JavaScript Frameworks
Get Started with JavaScript Frameworks
 
黑豹 ch4 ddd pattern practice (2)
黑豹 ch4 ddd pattern practice (2)黑豹 ch4 ddd pattern practice (2)
黑豹 ch4 ddd pattern practice (2)
 
Drools & jBPM Info Sheet
Drools & jBPM Info SheetDrools & jBPM Info Sheet
Drools & jBPM Info Sheet
 
Whats New In 2010 (Msdn & Visual Studio)
Whats New In 2010 (Msdn & Visual Studio)Whats New In 2010 (Msdn & Visual Studio)
Whats New In 2010 (Msdn & Visual Studio)
 
* DJANGO - The Python Framework - Low Kian Seong, Developer
    * DJANGO - The Python Framework - Low Kian Seong, Developer    * DJANGO - The Python Framework - Low Kian Seong, Developer
* DJANGO - The Python Framework - Low Kian Seong, Developer
 
Training institute in Bangalore
Training institute in BangaloreTraining institute in Bangalore
Training institute in Bangalore
 
Best training institute
Best training institute Best training institute
Best training institute
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
XRX Presentation to Minnesota OTUG
XRX Presentation to Minnesota OTUGXRX Presentation to Minnesota OTUG
XRX Presentation to Minnesota OTUG
 
Maintainable Javascript carsonified
Maintainable Javascript carsonifiedMaintainable Javascript carsonified
Maintainable Javascript carsonified
 
Mvvm pattern
Mvvm patternMvvm pattern
Mvvm pattern
 
Building Data Centric Apps in WPF
Building Data Centric Apps in WPFBuilding Data Centric Apps in WPF
Building Data Centric Apps in WPF
 
Overview of VS2010 and .NET 4.0
Overview of VS2010 and .NET 4.0Overview of VS2010 and .NET 4.0
Overview of VS2010 and .NET 4.0
 
Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with SilverlightRe-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

Architecting WPF Applications