Building Applications with WCF 
          RIA Services 
 Stephen Forte
 Chief Strategy Officer, Telerik
 www.telerik.com
 Stevef.hk@gmail.com
 S     f hk@     il
 Blog: Stephenforte.net
Speaker.Bio()
• Chief Strategy Officer of Telerik
• Certified Scrum Master
  Certified Scrum Master
• Active in the Community:
   – International Conference Speaker for 13+ Years
     International Conference Speaker for 13+ Years
   – RD, MVP and INETA Speaker 
   – Co‐moderator & founder of NYC .NET 
     Developers Group   http://www.nycdotnetdev.com
     D l        G       htt //          d t td
   – Wrote a few books: SQL Server 2008 Developers Guide 
     (MS Press)
• MBA from the City University of New York
• Past:
   – CTO and co‐Founder of Corzen, Inc. (TXV: WAN)
   – CTO of Zagat Survey 
N Tier Programming
N‐Tier Programming
RIA Services in n‐tier applications
                                       Trust
                                     Boundaryy
  Web
  W b
 Service

                    Data
                  Access      App                 App
                   Layer                                 View
                             Logic               Logic
                   (DAL)

Database




 Framework, tools and services with
 prescriptive pattern for n tier applications
 prescriptive pattern for n‐tier applications
Windows Communication Foundation (WCF)
Using the right tool for the job
         Using the right tool for the job
     WCF Layer              Description

     RIA Services
     RIA Services           Prescriptive E2E experience for Silverlight
                                         E2E experience for Silverlight 
                            applications
     Data Services          Turn‐key entity‐oriented programming 
                            model for HTTP/RESTful services
     Workflow Services      Workflow‐oriented programming model for 
                            long‐running business processes
                            long‐running business processes
     Service Model          Method‐oriented programming model for 
                            WS‐* & REST developers
1.    All programming models can leverage the wide‐ranging set of behaviors and 
      protocols
2.
2     We have good integration in SL4/Dev10, that gets even better in Dev11
      We have good integration in SL4/Dev10 that gets even better in Dev11

                                   Microsoft Confidential
RIA Services Design principles
    RIA Services Design principles
• End‐to‐end view of an application: framework, 
  pattern, tooling and services
              l      d
• Prescriptive approach to app logic 
• DAL‐neutral and targets multiple presentation 
  technologies
Data access & presentation neutral
Data access & presentation neutral



                 App
                Logic



      XML, 
      JSON, 
      Binary
Design‐time view


                          Solution (Application)

     Server project                                  Client project

Entities                                      Entities
                          Build, reflect
  Data                    & code-gen                            Views
Access          Domain
                                              Domain
 Layer          Service
                                              Context
 (DAL)
Run‐time view (entity lifecycle)
                        Application

     Web server                                 Silverlight
                                                Sil   li ht
                          Query                    Load
  Data
                          Entities    Domain     Entities
Access        Domain                                          Views
 Layer        Service                 Context
                                      C t t       Submit
                                                  S b it
                         Submit
 (DAL)
                          Results                 Results
• Demo
Services

•   Authentication
•   Roles
•   User profile
•   All integrate w/ ASP.NET infrastructure
Using RIA Services effectively
Do                             Don’t

• Require authentication / 
     q                   /     • Deploy with anon access
                                 Deploy with anon access
  roles
     – Authenticate w/ https
                               • E
                                 Expose non‐essential 
                                                    i l
• Utilize query composition
                                 entities/ operations or allow 
     – Filter, sort, page
                                 free‐form access to data
• Consider custom update
  Consider custom update

• Factor into multiple         • Use a single large 
  DomainService classes / 
  D      i S i     l    /        DomainService class
  libraries

• H dl
  Handle errors on server

• Use declarative validation
Questions? 

Introduction to WCF RIA Services for Silverlight 4 Developers

  • 1.
    Building Applications with WCF  RIA Services  Stephen Forte Chief Strategy Officer, Telerik www.telerik.com Stevef.hk@gmail.com S f hk@ il Blog: Stephenforte.net
  • 2.
    Speaker.Bio() • Chief Strategy Officer of Telerik • CertifiedScrum Master Certified Scrum Master • Active in the Community: – International Conference Speaker for 13+ Years International Conference Speaker for 13+ Years – RD, MVP and INETA Speaker  – Co‐moderator & founder of NYC .NET  Developers Group   http://www.nycdotnetdev.com D l G htt // d t td – Wrote a few books: SQL Server 2008 Developers Guide  (MS Press) • MBA from the City University of New York • Past: – CTO and co‐Founder of Corzen, Inc. (TXV: WAN) – CTO of Zagat Survey 
  • 3.
  • 4.
    RIA Services in n‐tier applications Trust Boundaryy Web W b Service Data Access App App Layer View Logic Logic (DAL) Database Framework, tools and services with prescriptive pattern for n tier applications prescriptive pattern for n‐tier applications
  • 5.
  • 6.
    Using the right tool for the job Using the right tool for the job WCF Layer Description RIA Services RIA Services Prescriptive E2E experience for Silverlight E2E experience for Silverlight  applications Data Services Turn‐key entity‐oriented programming  model for HTTP/RESTful services Workflow Services Workflow‐oriented programming model for  long‐running business processes long‐running business processes Service Model Method‐oriented programming model for  WS‐* & REST developers 1. All programming models can leverage the wide‐ranging set of behaviors and  protocols 2. 2 We have good integration in SL4/Dev10, that gets even better in Dev11 We have good integration in SL4/Dev10 that gets even better in Dev11 Microsoft Confidential
  • 7.
    RIA Services Design principles RIA Services Design principles • End‐to‐end view of an application: framework,  pattern, tooling and services l d • Prescriptive approach to app logic  • DAL‐neutral and targets multiple presentation  technologies
  • 8.
    Data access & presentation neutral Data access &presentation neutral App Logic XML,  JSON,  Binary
  • 9.
    Design‐time view Solution (Application) Server project Client project Entities Entities Build, reflect Data & code-gen Views Access Domain Domain Layer Service Context (DAL)
  • 10.
    Run‐time view (entity lifecycle) Application Web server Silverlight Sil li ht Query Load Data Entities Domain Entities Access Domain Views Layer Service Context C t t Submit S b it Submit (DAL) Results Results
  • 11.
  • 12.
    Services • Authentication • Roles • User profile • All integrate w/ ASP.NET infrastructure
  • 13.
    Using RIA Services effectively Do Don’t • Require authentication /  q / • Deploy with anon access Deploy with anon access roles – Authenticate w/ https • E Expose non‐essential  i l • Utilize query composition entities/ operations or allow  – Filter, sort, page free‐form access to data • Consider custom update Consider custom update • Factor into multiple  • Use a single large  DomainService classes /  D i S i l / DomainService class libraries • H dl Handle errors on server • Use declarative validation
  • 14.