Silverlight 4frameworks, patternsMike TaultyMicrosoft Ltd@mtaultymtaulty@microsoft.comhttp://mtaulty.com
capabilitiesneed to know some or all of this depending on what you’re building
beyond capabilities*lots of other Silverlight frameworks, libraries, patterns out there – sorry if I missed your favorite
where are we?ASP.NET Client Application ServicesWCF Data ServicesWCF RIA Servicesnavigationsearchextensible applications with MEF
ASP.NET Client App ServicesASP.NET services available to Silverlight clientsASP.NETmembershiprolesprofilesno specific client libraries here, just add a reference and make the call
enough hot air, do a demoASP.NET Services from Silverlight
where are we?ASP.NET Client Application ServicesWCF Data ServicesWCF RIA Servicesnavigationsearchextensible applications with MEF
RESTful services (in general)HTTP RequestURLResourcesVERBRes 1GETPayloadRes 2POSTPUTRes 3XMLJSONDELETERes 4XMLJSONHTTP ResponseStatusPayload
odataOpen Data Protocol ( odata)www.odata.orgpublished under the Open Specification PromiseExtends the AtomPub standard to addan addressing schemea mechanism for schemaalternate representation – JSONhandling for concurrent updateshandling for batched requests
WCF Data Services ( “Astoria” )http://server/customers(‘alfki’)/Orders?$top=20WCF Data ServicesLibrariesDataModelEntityFramework
LINQ to SQL
Customrequest metadataLINQ Querygenerated proxy codemetadata.NET OData ImplementationWCF Data ServicesLibrariesWindows Azure StorageJavaPHPSharePointWebSphereAtomimplementation of odatafor the client and the server“Other” OData Implementations
enough hot air, do a demoWCF Data Services from Silverlight
WCF Data ServicesoData – There’s a Feed for ThatoData – How to Create a Feed for ThatTo learn about OData go to Pablo/Mike’s talksTuesday 11.30amLagoon LTuesday 3pmBreakers H( check 2 B sure )
where are we?ASP.NET Client Application ServicesWCF Data ServicesWCF RIA Servicesnavigationsearchextensible applications with MEF
WCF RIA ServicesDomainServiceStateless CRUD + App Logicclass PlateViewDomainServiceIQueryable<Restaurant> GetRestaurants()IQueryable<Restaurant> SearchRestaurant(string)void AddRestaurant(Restaurant)Validation and authorization rules,        Application workflows, …Data Modelclass RestaurantDomainContextStateful view + Bindable Dataclass PlateViewDomainServiceEntityList<Restaurant> Books { get }EntityQuery<Restaurant> GetRestaurantQuery()EntityQuery<Restaurant> SearchRestaurantQuery(string)class RestaurantData members + ValidationData Model +Metadata +Shared CodeServicesRich Internet ApplicationPresentationLogicData Access LayerAppLogicNetworkDomainContextDataServiceDBUnder the covers infrastructureNote: Slide stolen from Brad Abrams
WCF RIA ServicesWCF RIA Services (fka .NET RIA Services)You’re building an applicationYou’re responsible for both server and client deep in business logic and semanticsWCF Data Services (fka “Astoria”)You’re exposing/acquiring dataYou control one side or the other, not bothCRUD among arbitrary producers / consumers logic and semantics are invisibleNB: Slide stolen from Brad Abrams
enough hot air, do a demoWCF RIA Services
WCF RIA ServicesDeveloping with WCF RIA ServicesQuickly & EffectivelyTo learn about WCF RIA Services go to Nikhil Kothari’s talkTuesday 1:30pmLagoon H( check 2 B sure )
where are we?ASP.NET Client Application ServicesWCF Data ServicesWCF RIA Servicesnavigationsearchextensible applications with MEF
navigationPageFrame displays a PagePage<UserControl> <Frame          Source=“authors.xaml”/>authors.xamlnavigation between pagescall Frame.Navigate() or set the Source propertyor use a HyperlinkButton ( NavigateUri/TargetName )navigation historycall Frame.[Can]Go[Back()/Forward()]books.xaml
navigationPageFrame displays a PagePage<UserControl> <Frame          Source=“authors.xaml”/>authors.xamlnavigation can integrate with the browserenables hyperlinking into Silverlight contentrequires a browser!requires a hidden iframe on the hosting pagefor top levelFrames not nested framesbooks.xaml
navigationnavigate:	http://booksite/default.aspx#/authors/steinbecknavigate:	/authors/steinbeckFrameUriMapperContentLoaderAsynchronously turns the URI into a Page or UserControl
enough hot air, do a demoNavigation Framework in Silverlight 4
where are we?ASP.NET Client Application ServicesWCF Data ServicesWCF RIA Servicesnavigationsearchextensible applications with MEF
searchsearch engines visiting a page with Silverlightread robots.txt and sitemapread/index the page titleread/index the <meta name=“description”/>read/index the surrounding HTML( if any )will not read XAP or dynamic Silverlight contentapproachalternate content in the <object/> tagfor both search engines & down-level clients
enough hot air, do a demooffering alternate content to searchnote – I stole this demo, it comes from the WCF RIA Services Code Gallery and is called “Silverlight Store”
WCF RIA ServicesSearch Engine Optimization for MS SilverlightTo learn more about SEO go to Brad Abrams’ talkWednesday 12.00Lagoon B( check 2 B sure )
where are we?ASP.NET Client Application ServicesWCF Data ServicesWCF RIA Servicesnavigationsearchextensible applications with MEF
extensible applications with MEFthe Managed Extensibility Framework“an extensible framework for composing applications from a set of loosely-coupled parts discovered and evolving at run-time“ (mike)versions.NET Framework shipping with Silverlight 4 .NET Framework 4 shipping with VS 2010Silverlight 3 & .NET Framework V3.5 Sp1 ( from source on CodePlex )
essential MEFimport(e.gDebuggerVisualizer)export(e.gDebuggerVisualizer)Component(e.g. Visual Studio)Component(e.g. XML Visualizer)MEF Composition EngineMEF discovers exports via catalogsseveral “in box” catalogs plus many extensibility pointssupports available exports changing at runtimeand/or can be handed component instances
one application of MEFinitial, small downloadMyApp.xapExtras.xapadditional functionality
enough hot air, do a demothe Managed Extensibility Framework
MEFSilverlight Optimization &  Extensibility with MEFTo really learn about MEF go along to Glenn Block’s talkTuesday, 3.35pmLagoon B( check 2 B sure )
where are we?ASP.NET Client Application ServicesWCF Data ServicesWCF RIA Servicesnavigation & searchextensible applications with MEFModel View ViewModel (MVVM)

Mike Taulty MIX10 Silverlight Frameworks and Patterns

  • 1.
    Silverlight 4frameworks, patternsMikeTaultyMicrosoft Ltd@mtaultymtaulty@microsoft.comhttp://mtaulty.com
  • 2.
    capabilitiesneed to knowsome or all of this depending on what you’re building
  • 3.
    beyond capabilities*lots ofother Silverlight frameworks, libraries, patterns out there – sorry if I missed your favorite
  • 4.
    where are we?ASP.NETClient Application ServicesWCF Data ServicesWCF RIA Servicesnavigationsearchextensible applications with MEF
  • 5.
    ASP.NET Client AppServicesASP.NET services available to Silverlight clientsASP.NETmembershiprolesprofilesno specific client libraries here, just add a reference and make the call
  • 6.
    enough hot air,do a demoASP.NET Services from Silverlight
  • 7.
    where are we?ASP.NETClient Application ServicesWCF Data ServicesWCF RIA Servicesnavigationsearchextensible applications with MEF
  • 8.
    RESTful services (ingeneral)HTTP RequestURLResourcesVERBRes 1GETPayloadRes 2POSTPUTRes 3XMLJSONDELETERes 4XMLJSONHTTP ResponseStatusPayload
  • 9.
    odataOpen Data Protocol( odata)www.odata.orgpublished under the Open Specification PromiseExtends the AtomPub standard to addan addressing schemea mechanism for schemaalternate representation – JSONhandling for concurrent updateshandling for batched requests
  • 10.
    WCF Data Services( “Astoria” )http://server/customers(‘alfki’)/Orders?$top=20WCF Data ServicesLibrariesDataModelEntityFramework
  • 11.
  • 12.
    Customrequest metadataLINQ Querygeneratedproxy codemetadata.NET OData ImplementationWCF Data ServicesLibrariesWindows Azure StorageJavaPHPSharePointWebSphereAtomimplementation of odatafor the client and the server“Other” OData Implementations
  • 13.
    enough hot air,do a demoWCF Data Services from Silverlight
  • 14.
    WCF Data ServicesoData– There’s a Feed for ThatoData – How to Create a Feed for ThatTo learn about OData go to Pablo/Mike’s talksTuesday 11.30amLagoon LTuesday 3pmBreakers H( check 2 B sure )
  • 15.
    where are we?ASP.NETClient Application ServicesWCF Data ServicesWCF RIA Servicesnavigationsearchextensible applications with MEF
  • 16.
    WCF RIA ServicesDomainServiceStatelessCRUD + App Logicclass PlateViewDomainServiceIQueryable<Restaurant> GetRestaurants()IQueryable<Restaurant> SearchRestaurant(string)void AddRestaurant(Restaurant)Validation and authorization rules, Application workflows, …Data Modelclass RestaurantDomainContextStateful view + Bindable Dataclass PlateViewDomainServiceEntityList<Restaurant> Books { get }EntityQuery<Restaurant> GetRestaurantQuery()EntityQuery<Restaurant> SearchRestaurantQuery(string)class RestaurantData members + ValidationData Model +Metadata +Shared CodeServicesRich Internet ApplicationPresentationLogicData Access LayerAppLogicNetworkDomainContextDataServiceDBUnder the covers infrastructureNote: Slide stolen from Brad Abrams
  • 17.
    WCF RIA ServicesWCFRIA Services (fka .NET RIA Services)You’re building an applicationYou’re responsible for both server and client deep in business logic and semanticsWCF Data Services (fka “Astoria”)You’re exposing/acquiring dataYou control one side or the other, not bothCRUD among arbitrary producers / consumers logic and semantics are invisibleNB: Slide stolen from Brad Abrams
  • 18.
    enough hot air,do a demoWCF RIA Services
  • 19.
    WCF RIA ServicesDevelopingwith WCF RIA ServicesQuickly & EffectivelyTo learn about WCF RIA Services go to Nikhil Kothari’s talkTuesday 1:30pmLagoon H( check 2 B sure )
  • 20.
    where are we?ASP.NETClient Application ServicesWCF Data ServicesWCF RIA Servicesnavigationsearchextensible applications with MEF
  • 21.
    navigationPageFrame displays aPagePage<UserControl> <Frame Source=“authors.xaml”/>authors.xamlnavigation between pagescall Frame.Navigate() or set the Source propertyor use a HyperlinkButton ( NavigateUri/TargetName )navigation historycall Frame.[Can]Go[Back()/Forward()]books.xaml
  • 22.
    navigationPageFrame displays aPagePage<UserControl> <Frame Source=“authors.xaml”/>authors.xamlnavigation can integrate with the browserenables hyperlinking into Silverlight contentrequires a browser!requires a hidden iframe on the hosting pagefor top levelFrames not nested framesbooks.xaml
  • 23.
  • 24.
    enough hot air,do a demoNavigation Framework in Silverlight 4
  • 25.
    where are we?ASP.NETClient Application ServicesWCF Data ServicesWCF RIA Servicesnavigationsearchextensible applications with MEF
  • 26.
    searchsearch engines visitinga page with Silverlightread robots.txt and sitemapread/index the page titleread/index the <meta name=“description”/>read/index the surrounding HTML( if any )will not read XAP or dynamic Silverlight contentapproachalternate content in the <object/> tagfor both search engines & down-level clients
  • 27.
    enough hot air,do a demooffering alternate content to searchnote – I stole this demo, it comes from the WCF RIA Services Code Gallery and is called “Silverlight Store”
  • 28.
    WCF RIA ServicesSearchEngine Optimization for MS SilverlightTo learn more about SEO go to Brad Abrams’ talkWednesday 12.00Lagoon B( check 2 B sure )
  • 29.
    where are we?ASP.NETClient Application ServicesWCF Data ServicesWCF RIA Servicesnavigationsearchextensible applications with MEF
  • 30.
    extensible applications withMEFthe Managed Extensibility Framework“an extensible framework for composing applications from a set of loosely-coupled parts discovered and evolving at run-time“ (mike)versions.NET Framework shipping with Silverlight 4 .NET Framework 4 shipping with VS 2010Silverlight 3 & .NET Framework V3.5 Sp1 ( from source on CodePlex )
  • 31.
    essential MEFimport(e.gDebuggerVisualizer)export(e.gDebuggerVisualizer)Component(e.g. VisualStudio)Component(e.g. XML Visualizer)MEF Composition EngineMEF discovers exports via catalogsseveral “in box” catalogs plus many extensibility pointssupports available exports changing at runtimeand/or can be handed component instances
  • 32.
    one application ofMEFinitial, small downloadMyApp.xapExtras.xapadditional functionality
  • 33.
    enough hot air,do a demothe Managed Extensibility Framework
  • 34.
    MEFSilverlight Optimization & Extensibility with MEFTo really learn about MEF go along to Glenn Block’s talkTuesday, 3.35pmLagoon B( check 2 B sure )
  • 35.
    where are we?ASP.NETClient Application ServicesWCF Data ServicesWCF RIA Servicesnavigation & searchextensible applications with MEFModel View ViewModel (MVVM)