1. Building Business Centric Applications with Silverlight 3 and .NET RIA Services Brad Abrams Product Unit manager Microsoft http://blogs.msdn.com/brada Twitter: @brada
2. Vision and Goals Simplify RIA-style application development n-tier is hard, and un-natural Focus on data-driven apps Bring ASP.NET-style productivity to RIA development Building blocks for data, security, etc. Focus on scenarios
3. Value Propositions Focus on data in an end-to-end manner A unified story for client and server development A prescriptive framework that targets key scenarios, and leads the common developer to a pit of success
4. Service Rich Internet Application Browser Application DB Other Applications A Unified Story for Client and Server Client is an extension of the server A single logical application Presentation Logic Data Access Layer App Logic HTML Network Services
5. A Prescriptive Pattern DomainService Stateless CRUD + App Logic class LibraryService IQueryable<Books> GetBooks() IQueryable<Book> SearchBooks(string) void AddBook(Book) void RequestBook(Book) Validation and authorization rules, Application workflows, … Data Model class Book DomainContext Stateful view + Bindable Data class LibraryContext EntityList<Book> Books { get } EntityQuery<Book> GetBooksQuery() EntityQuery<Book> SearchBooksQuery(string) void RequestBook(Book) class Book Data members + Validation void RequestBook() Data Model + Metadata + Shared Code Services Rich Internet Application Presentation Logic Data Access Layer App Logic Network DomainContext Data Service DB Under the covers infrastructure
6. A Single Pattern that Scales and Grows Support for multiple presentation tiers and data access technologies Databases ADO.NET, ORMs (LTS, EF, …) .NET Clients Silverlight, WPF Standards Clients JavaScript App Logic CLR Lists/Objects Repository (nHibernate, …) Server Rendering HTML, SEO, Printing, … SOAP, XML, JSON, Binary Services REST/SOAP (Azure, …) Services WCF Unit Test Code
7. Summary RIA Services focuses on writing n-tier apps by treating them as one logical application Still get n-tier goodness from the architecture/pattern without the plumbing getting in your way RIA Services provides a pattern for encapsulating application logic on the middle tier that can be useful in a variety of scenarios DAL-agnostic Multiple presentation layers
8. Roadmap and Resources First public preview at MIX ’09 http://code.msdn.microsoft/riaservices Links to bits, docs, samples, forums Next big release is at PDC ‘09 Slides + sample code http://www.nikhilk.net Other blogs http://blogs.msdn.com/brada
10. Patterns for Separating UI and Logic MVC, MVP, ViewModel, … General approach Separate interaction logic from view Decouple components of app Motivations Loosely coupled building blocks Designer-developer workflow Greater degree of testability User Interface Interaction Logic Data Model
11. ViewModel Pattern MVVM (Model – View – ViewModel), Presentation Model Basic idea View model encapsulates application behavior independent of view View is responsible for rendering and user input Leverage data-binding and commanding to hook up view to its view model
13. Interaction Logic in Code-behind View XAML Data Model Code-Behind Event Handlers
14. Interaction Logic in View Model View XAML Code-Behind Property change and other event notifications Data-binding and commands View Model Data Model State + Operations + Notifications