• Save

Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

PRISM and Silverlight

on

  • 6,473 views

Ian Smith from www.irascian.com gives the Silverlight UK User Group, his thoughts on PRISM and its usage with Silverlight. ...

Ian Smith from www.irascian.com gives the Silverlight UK User Group, his thoughts on PRISM and its usage with Silverlight.

This presentation was given on 29th September 2009 at the EMC Consulting offices in London.

Statistics

Views

Total Views
6,473
Views on SlideShare
6,375
Embed Views
98

Actions

Likes
4
Downloads
0
Comments
0

4 Embeds 98

http://osintanalyst.com 40
http://66.147.244.96 26
http://www.slideshare.net 17
http://consultingblogs.emc.com 15

Accessibility

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

PRISM and Silverlight PRISM and Silverlight Presentation Transcript

  • Tips and tools for creating and presenting wide format slides
    Widescreen Presentation
  • Widescreen Advantages
    Side by side material fits more naturally.
    Widescreen adds drama to graphics and images.
    Agenda
    PRISM
    • What is it?
    • Documentation and Installation
    • PRISM Patterns
    • Quickstarts
    • MVVM
    • MEF
    • Reducing the Cut and Paste Overhead
    PRISM and .NET RIA Services
  • Widescreen Advantages
    Side by side material fits more naturally.
    Widescreen adds drama to graphics and images.
    Up-Front Disclaimer
    • Stealing one person’s work is plagiarism
    • Stealing several people’s work is research ;-)
    Note: Most photos used in this presentation were purchased from IStockPhoto.com, who retain copyright.
    PRISM and .NET RIA Services
  • Widescreen Advantages
    Side by side material fits more naturally.
    Widescreen adds drama to graphics and images.
    If PRISM Were a Party
    PRISM and .NET RIA Services
  • Widescreen Advantages
    Side by side material fits more naturally.
    Widescreen adds drama to graphics and images.
    What is PRISM? – Microsoft P&P Definition
    • Composite Application Library source code
    • Unity Extensions for Composite Application Library source code and binaries
    • A Reference Implementation (Stock Trader)
    • PRISM QuickStarts
    • Documentation (chm and PDF formats)
    Ref: http://www.microsoft.com/prism
    PRISM and .NET RIA Services
  • Widescreen Advantages
    Side by side material fits more naturally.
    Widescreen adds drama to graphics and images.
    What is PRISM? – (Better) Sparkling Client Definition
    • A collection of libraries (a smorgasboard or buffet of options) for implementing best practices in Silverlight and WPF
    • It supports modularity, master pages (regions), loosely-coupled communication (eventing),commanding (MVVM help!) and multi-targetting (WPF and Silverlight code sharing).
    • Most Silverlight/WPF apps can benefit from PRISM
    Ref: http://www.sparklingclient.com/prism-silverlight/
    PRISM and .NET RIA Services
  • Widescreen Advantages
    Side by side material fits more naturally.
    Widescreen adds drama to graphics and images.
    PRISM - Portable, Reusable, Integrated Software Modules
    • Dynamic/on-demand load of XAP files
    • Remove component dependencies
    • Make code more maintainable
    • Make code more testable
    • Ease team development
    • Provide Commanding support for MVVM
    • Provide reuse of code across applications
    • Maintain separation of roles
    • Reduce contention between multiple developers
    • Reduceinitial XAP file download size
    • Share code between WPF and Silverlight
    Ref: Thanks to @pauliom for coming up with a PRISM acronym!
    PRISM and .NET RIA Services
  • Widescreen Advantages
    Side by side material fits more naturally.
    Widescreen adds drama to graphics and images.
    PRISM – Why Should I Care What The Old Fart Presenter Says?
    “We’re trying to take some of those PRISM concepts and bake them directly into Silverlight and WPF… You’re going to see much more native support for MVVM. A lot of things in PRISM today you’ll see the same or some flavour of it in the core that make the PRISM concepts easier to apply.”
    Scott GuthrieCorporate VP .NET Developer Division Online Q&A, 28th May 2009
    “If you want guidance, than I say that something like PRISM is good for you in almost any business application”
    “I see a lot of applications go wrong. They tend to go wrong in the same way over and over again. The concepts that PRISM fosters help you find a way out of those familiar mistakes.”
    Ward BellDevForce Product Manager, IdeaBladehttp://neverindoubtnet.blogspot.com/2009/05/are-we-overselling-prism.html
    PRISM and .NET RIA Services
  • Widescreen Advantages
    Side by side material fits more naturally.
    Widescreen adds drama to graphics and images.
    PRISM Guidance Documentation
    Get the PDF
    Version here
    Ref: http://compositewpf.codeplex.com/Release/ProjectReleases.aspx?
    ReleaseId=14982
    PRISM and .NET RIA Services
  • Widescreen Advantages
    Side by side material fits more naturally.
    Widescreen adds drama to graphics and images.
    PRISM – Why so much documentation?
    Guidance for WPF and Silverlight
    Library and Baseline Architecture
    Design Concepts
    Technical Concepts and How-Tos
    Container
    Modularity
    Bootstrapper
    Commands
    Communication
    Container and Services
    Deployment
    UI Composition
    Multi-Targetting
    Event Aggregation
    Module
    Multi-Targeting
    Region
    Shell and View
    UI Composition
    QuickStarts and Hands-On Lab
    Patterns
    Commanding
    WPF HOL
    Event Aggregation
    Patterns Overview
    Silverlight HOL
    Multi-Targeting
    UI Comp
    Reference Implementation
    Designer Guidance
    Ref: PRISM Guidance Documentation(Page 9 of PDF version)
    Stock Trader Ref Impl
    PRISM and .NET RIA Services
  • Widescreen Advantages
    Side by side material fits more naturally.
    Widescreen adds drama to graphics and images.
    PRISM Download and Installation
    PRISM (June 2008) = WPF only
    PRISM v2 (Feb 2009) = WPF and Silverlight
    MSDN/Microsoft Download
    Only needed for
    Multi-Targetting of WPF and Silverlight
    CodePlex Documentation (“The Book”)
    This is the one you need for PRISM2 (PDF format)
    Ref: http://www.sparklingclient.com/downloading-and-building-prism/
    PRISM and .NET RIA Services
  • Widescreen Advantages
    Side by side material fits more naturally.
    Widescreen adds drama to graphics and images.
    PRISM Patterns
    Composite User Interface
    Modularity
    Testability
    • Composite and Composite View
    • Command
    • Adapter
    • Separated Interface and Plug-in
    • Service Locator
    • Event Aggregator
    • Facade
    • Inversion of Control
    • Separated Presentation (MVVM)
    Host Application
    Inversion of
    Control
    Plug in
    Shell
    Loading Services
    Adapter
    Shell
    Presenter
    Registry
    Composite View
    Service/DependencyInjection
    Container
    Serparated Interface
    Region
    Command
    Event Aggregator
    Core Services
    Modules
    View
    ViewModel
    Separated Presentation
    Service
    Locator
    Module Proferred Services
    Model
    PRISM and .NET RIA Services
  • Widescreen Advantages
    Side by side material fits more naturally.
    Widescreen adds drama to graphics and images.
    Regions
    The following controls can be exposed as regions:
    • System.Windows.Controls.ContentControl(and derived controls)
    • System.Windows.Controls.ItemsControl (and derived controls)
    • Controls derived from System.Windows.Controls.Primitives.Selector (egTabControl)
    Name=“BannerRegion”
    Name=“NewsRegion”
    Name=
    “NavigationRegion”
    Name=“ContentRegion”
    PRISM and .NET RIA Services
  • Widescreen Advantages
    Side by side material fits more naturally.
    Widescreen adds drama to graphics and images.
    Demo – Regions “Hello World”
    PRISM and .NET RIA Services
  • Widescreen Advantages
    Side by side material fits more naturally.
    Widescreen adds drama to graphics and images.
    Services
    • Provide functionality to other components in a loosely-coupled way through an interface. Often a singleton.
    • Any functionality that you need which provides an API surface is a service.
    • PRISM provides some services (IUnityContainer, IRegionManager,IEventAggregator)
    PRISM and .NET RIA Services
  • Widescreen Advantages
    Side by side material fits more naturally.
    Widescreen adds drama to graphics and images.
    The Container
    The place you go to ask for a service(usually at an interface level)
    • Allows multiple modules to talk to each other without having a direct reference
    • Handles lifetime management
    • PRISM is not hung up about who the provider is
    Unity
    Ninject
    Castle Windsor
    PRISM and .NET RIA Services
  • Widescreen Advantages
    Side by side material fits more naturally.
    Widescreen adds drama to graphics and images.
    Modules
    • Modules can be discovered and loaded at run time.
    • Modules are self-contained but can communicate with
    other modules and access services
    • Modules reduce the friction of maintaining, adding and removing system functionality.
    Define/Discover Modules
    Load
    Modules
    Initialize Modules
    PRISM and .NET RIA Services
  • Widescreen Advantages
    Side by side material fits more naturally.
    Widescreen adds drama to graphics and images.
    Modules – QuickStart Code Review
    Bootstrapper
    Unity Bootstrapper
    ModuleCatalog
    Module Manager
    IModuleTypeLoader
    ModuleInfoGroup
    ModuleInitializer
    Modules
    ModuleInfo
    W
    X
    Y
    Z
    PRISM and .NET RIA Services
  • Widescreen Advantages
    Side by side material fits more naturally.
    Widescreen adds drama to graphics and images.
    Quick Starts
    • Modularity
    • Defining Modules in Code
    • Remote Modularity
    • View Discovery and Composition
    • View Discovery Composition
    • View Injection Composition
    • Commanding
    • Handling UI Interactions in a de-coupled way
    • Event Aggregation
    • Establish Loosel-coupled communications between components
    • Multi-Targetting
    • Creating applications to multi-target desktop WPF and Silverlight RIA
    PRISM and .NET RIA Services
  • Widescreen Advantages
    MVC vs MVP vs MVVM
    MVC
    MVP
    MVVM
    User Interaction
    User Interaction
    User Interaction
    Side by side material fits more naturally.
    Widescreen adds drama to graphics and images.
    Passes calls to
    Passes calls to
    Passes calls to
    View
    View
    View
    Fires events (Sync)
    Fires events
    Updates
    Fires events (Sync)
    Fires events
    ViewModel
    Presenter
    Controller
    Model
    Model
    Model
    Manipulates
    Manipulates
    Manipulates
    Ref: http://nirajrules.wordpress.com/2009/07/18/mvc-vs-mvp-vs-mvvm/
    PRISM and .NET RIA Services
  • MVVM
    Unit Testing
    View
    XAML
    No (or very little) code behind
    Data Template
    Data binds to ViewModel properties including UI Commands
    Data
    Binding
    Change
    Notification
    Command
    Binding
    Exposes public properties. Abstracting Model
    Exposes Commands as PRISM DelegateCommand<T>
    Business Layer performs Actions on Model eg CRUD
    INotifyPropertyChanged
    ViewModel
    Change
    Notification
    Data
    Passthrough
    Model
    Business Layer
    Exposes public properties.
    IDataErrorInfo
    INotifyPropertyChanged
    Data Layer
    Ref: http://karlshifflett.wordpress.com/2008/11/08/learning-wpf-m-v-vm/
    PRISM and .NET RIA Services
  • Widescreen Advantages
    Side by side material fits more naturally.
    Widescreen adds drama to graphics and images.
    Commanding
    DelegateCommand<T>
    PRISM and .NET RIA Services
  • Widescreen Advantages
    Side by side material fits more naturally.
    Widescreen adds drama to graphics and images.
    Event Aggregation
    Subscriber
    Event Aggregator
    Publisher
    CompositePresentationEvent
    CompositePresentationEvent
    Subscriber
    Publisher
    Subscriber
    PRISM and .NET RIA Services
  • Widescreen Advantages
    Side by side material fits more naturally.
    Widescreen adds drama to graphics and images.
    MEF
    Managed Extensability Framework
    • v1.0 Intended for application extensibility after delivery
    • .xap “load on demand” capability (PRISM overlap)
    • Under the hood “IoC on steroids” = just another PRISM “provider”?
    • Ships with .NET 4.0/Visual Studio 2010
    • Available (on CodePlex) for Visual Studio 2008 SP1
    • Takes modularisation to the next level
    • Future version: XAML Markup extension for Silverlight to allow properties to be wired up for contracts and offer first class support for declaring catalogues in XAML
    PRISM and .NET RIA Services
  • Widescreen Advantages
    Side by side material fits more naturally.
    Widescreen adds drama to graphics and images.
    Ongoing Constructive Debate
    PRISM Event Aggregation
    “Herding Code” podcasts #58 and #59
    herdingcode.com
    Presentation Patterns Parts 1 and 2
    Jeremy Miller (“Presentation Patterns” author)
    Ward Bell (DevForce)
    Glenn Block (Microsoft P&P, MEF)
    Rob Eisenberg (Caliburn)
    “Clever. But it feels like a HACK. Here’s why it was done that way...”
    “The PRISM implementation is clunky and awkward to use”
    “Yes. It smells wrong. How about this instead ....?”
    Ward Bell
    Glenn Block
    Jeremy D Miller
    Code Behind in the View
    “That can make the code harder to maintain”
    “I don’t like any code behind in the View”
    Glenn Block
    Shawn Wildermuth
    PRISM and .NET RIA Services
  • Widescreen Advantages
    PRISM Co-existence with Blend
    • Put all resources in resource dictionaries (in infrastructure project)
    • Add an App.xaml file to each module (project)
    • Add link to the resource dictionary in each App.xaml
    • Modify csproj file to conditionally load App.xamlfile for Blend
    Ref: http://johnpapa.net/silverlight/using-blend-with-prism-apps-in-silverlight-3/
    PRISM and .NET RIA Services
  • Widescreen Advantages
    PRISM – Removing the ‘Plumbing’ Overhead
    • Dave Hill’s PRISM Quick Start Kit (and update) http://blogs.msdn.com/dphill/archive/2009/06/15/prism-quick-start-kit-update.aspx
    • Dave Kehring’sSnippet for PRISM DelegateCommandhttp://blog.whconsult.com/2009/02/01/CodeSnippetForPrismDelegateCommand.aspx
    • Andrea Boschin’sSnippet for Writing PRISM Commandshttp://www.silverlightplayground.org/post/2009/07/09/A-code-snippet-to-quickly- write-Prism-commands.aspx
    Ref: http://blogs.msdn.com/devkeydet/archive/2009/07/17/prism-visual-studio-templates-including-mvvm.aspx
    PRISM and .NET RIA Services
  • Widescreen Advantages
    .NET RIA Services – Road Map
    • July 2009 – Updated ‘Preview’ Release Lots of changes since MIX ‘Alpha Preview’ (Feb 2009) and May 2009 CTP
    • “At your own risk Go live” license
    • November 2009 (PDC) – Beta
    • Core feature work
    • Visual Studio 2010/.NET 4 support
    • Move to ADO.NET Data Services as underlying protocol
    • 2010 (MIX in February?) Release To Web
    • Alignment with other products
    Ref: http://silverlight.net/forums/p/101160/230835.aspx#230835
    PRISM and .NET RIA Services
  • Widescreen Advantages
    .NET RIA Services – N-Tier Design
    Web Service
    View
    Context
    Service
    Database
    Data
    Access
    Layer
    (DAL)
    Code Gen
    Object
    Metadata
    Shared Code
    Shared Code
    Application Logic
    Application Logic
    .NET RIA Services
    PRISM and .NET RIA Services
  • Widescreen Advantages
    Side by side material fits more naturally.
    Widescreen adds drama to graphics and images.
    .NET RIA Services - Demo
    Demonstration of
    • The RIA Link
    • Create a DomainService class
    • Build solution and examine Generated_Code folder
    • Add MetaData to the Entity
    • Sharing files between Client and Server
    Warning: .NET RIA Services and Resharper do not play well together because Resharper can’t see the Generated Code and will throw errors.
    PRISM and .NET RIA Services
  • Widescreen Advantages
    Links
    Brad Abrams bloghttp://blogs.msdn.com/brada
    Nikhil Khotari bloghttp://www.nikhilk.net/
    Downloading PRISM Guide
    http://www.sparklingclient.com/downloading-and-building-prism/
    Using PRISM and .NET RIA Services Together
    http://blogs.msdn.com/dphill/archive/2009/08/17/prism-and-net-ria-services.aspx
    Using Silverlight 3 Navigation with PRISM
    http://www.codeproject.com/KB/silverlight/sl3prismnav.aspx
    Sparkling Client podcastshttp://www.sparklingclient.com/
    Shawn Wildermuth bloghttp://wildermuth.com/
    Ward Bell blog
    http://neverindoubtnet.blogspot.com/
    Glenn Block blog
    http://blogs.msdn.com/gblock/
    John Papa blog
    http://johnpapa.net/
    PRISM and .NET RIA Services
  • Tips and tools for creating and presenting wide format slides
    Widescreen Presentation
    Questions?