• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Architecting WPF Applications
 

Architecting WPF Applications

on

  • 5,667 views

A presentation given at the Sydney Architecture User Group.

A presentation given at the Sydney Architecture User Group.

Statistics

Views

Total Views
5,667
Views on SlideShare
5,349
Embed Views
318

Actions

Likes
1
Downloads
197
Comments
0

8 Embeds 318

http://www.paulstovell.com 174
http://paulstovell.com 112
http://www.slideshare.net 20
http://www.paulstovell.net 4
http://theoldreader.com 4
http://blogs.msdn.com 2
file:// 1
http://translate.googleusercontent.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Architecting WPF Applications Architecting WPF Applications Presentation Transcript

    • 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