prism tech ed india

25

Upload: rsnarayanan

Post on 10-May-2015

584 views

Category:

Technology


7 download

TRANSCRIPT

Page 1: Prism Tech Ed India
Page 2: Prism Tech Ed India

Developing Line of Business apps using WPF and Silverlight

Blaine WastellProgram ManagerMicrosoftSession Code:

Page 3: Prism Tech Ed India

AgendaWhat Is Prism and What Does It Do?

Client Application ChallengesWhat’s In The Box?

Modularity PatternsUI Composition PatternsSeparated Presentation PatternsCommanding & Eventing PatternsMulti-Targeting Sharing Code Between WPF And Silverlight

Page 4: Prism Tech Ed India

The Challenge

Page 5: Prism Tech Ed India

The Solution

Page 6: Prism Tech Ed India

The Problem:Client Applications are Challenging!Beyond the Bling – How To Make The ApplicationDynamic, Customizable, Extensible, Testable?

The Solution:Break App Into PiecesManage Dependencies Between PiecesRe-assemble App From Pieces

Prism – Patterns For Composite Client Apps

Composite Client Applications

Page 7: Prism Tech Ed India

Prism – Composite Client Application Guidance for WPF and Silverlight

LibraryReference ImplementationDocumentationQuick-Starts & How-To’sCommunity – CodePlex

Prism 1.0 – WPFReleased July 2008

Prism 2.0 – WPF & SilverlightReleased Feb 2009

Prism – What’s In The Box?

Page 8: Prism Tech Ed India

Reference Implementation

Page 9: Prism Tech Ed India

The StockTrader Reference Implementation

demo

Page 10: Prism Tech Ed India

Prism Core Concepts

Page 11: Prism Tech Ed India

Modules

Unit Of Application AssemblyCollection of Related ComponentsFeature, Services, Views, Data AccessSlice & Dice: Mandatory, Optional, Role Specific

Unit Of DevelopmentIndependent DevelopmentIndependent Testing

Unit Of DeploymentUp-Front, Background or On-Demand

Page 12: Prism Tech Ed India

ModulesModule Discovery

Pluggable CatalogsModule Loading

Background or On-Demand

Module Loader

Extended InPrism 2.0!

XAP

XAP

XAP

Page 13: Prism Tech Ed India

Modules and Catalogsdemo

Page 14: Prism Tech Ed India

Shell – Application Host WindowRegions – Named Areas For View PlacementViews – Module UI & Presentation LogicView Injection Visual Composition

UI Composition

Region Region

Region<ContentControl RegionManager.RegionName= “DetailsRegion” />

IPositionPresentationModel presentationModel = …;

IRegion mainRegion = regionManager.Regions[ "MainRegion" ];

mainRegion.Add( presentationModel.View );

<ItemsControl RegionManager.RegionName= "MainRegion">

Page 15: Prism Tech Ed India

UI Composition

View Discovery Visual Composition:Less ComplexBlack Box ‘App Assembly’ CompositionSelect Views & Pull into Region

Region Region

Region<ContentControl RegionManager.RegionName= "DetailsRegion”/>

<ItemsControl RegionManager.RegionName= "MainRegion”/>

New InPrism 2.0!

regionManager.RegisterViewWithRegion( "MainRegion", typeof( MainView ) );

Page 16: Prism Tech Ed India

UI Compositiondemo

Page 17: Prism Tech Ed India

Commands and EventsDelegate & Composite Commands

Simplified Command HandlingEvent Aggregator

Loosely Coupled Pub/Sub Events

Module B

CustomerPresenter

Module A

OrderPresenter

EventAggregator

Subscribe

Publ

ish

Event

Page 18: Prism Tech Ed India

Separated Presentation

Presenter

Model

View

PresentationModel ModelView

Prism 1.0Supervising PresenterPresentation Model

Prism 2.0More Concrete Guidance on Using These Patterns…“Model-View-ViewModel”How To Be Designer FriendlyModeling Presentation State (Not UI State)Ultra Thin Views – Data Templates

Page 19: Prism Tech Ed India

WPF

SILV

ERLI

GH

T

CLR - Silverlight CLR Desktop

BCL BCL

BROWSER DESKTOP

Multi-TargetingUser Experiences

Desktop – In the Office, Full Functionality, Offline CapableRIA – Out of the Office, Functional Subset, Online

How to Share Code & Components?

Controllers

Models

Presenters

Views

Models

Controllers

Presenters

Views

Page 20: Prism Tech Ed India

Multi-Targeting: StrategiesStart With LCD – SilverlightSeparated Presentation StrategiesSingle Source, Cross CompiledLinks and Parallel Project StructuresIf Not:

#IF SILVERLIGHTPartial Classes

Partial MethodsSeparate Classes/Services

Page 21: Prism Tech Ed India

Multi-Targetingdemo

Page 22: Prism Tech Ed India

SummaryPrism 1.0

Library of Patterns for Enterprise Client AppsTargets WPF on the Desktop

Prism 2.0Extends Prism to Silverlight RIA ApplicationsExtended Patterns for UI Composition, Separated Presentation, ModularityMulti-Targeting – Extend user experience & re-use code and components

Download from MSDN & CodePlex

Send us feedback & ideas for Prism 3.0!

Page 23: Prism Tech Ed India

Where Can You Find Prismwww.microsoft.com/prismwww.codeplex.com/prismhttp://blogs.msdn.com/blaine

Page 24: Prism Tech Ed India

question & answer

Page 25: Prism Tech Ed India

© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS,

IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.