Silverlight & LOB applications
Dennis van der Stelt
Class-A
• Class-A– Kennisprovider– Microsoft development – Training & Coaching– http://www.class-a.nl
• Dennis van der Stelt– Trainer/ coach– Blog: http://bloggingabout.net/blogs/dennis/ – Twitter: dvdstelt
Introducing
Agenda
• SQL Data Services, or not…• .NET RIA Services• Demo
SQL DATA SERVICESACE vs RDBMS
SQL Data Services
SQL Data ServicesSqlConnectionStringBuilder connStringBuilder = new SqlConnectionStringBuilder();connStringBuilder.DataSource = "myserver.data.dev.mscds.com";connStringBuilder.InitialCatalog = "mydatabase";connStringBuilder.Encrypt = true;connStringBuilder.UserID = "flitsservice“;connStringBuilder.Password = "****";
string createTableSql = @"CREATE TABLE [dbo].[tbl_Person] ( [FirstName] NVARCHAR(64) NOT NULL, [LastName] NVARCHAR(64) NOT NULL CONSTRAINT [personName_PK] PRIMARY KEY CLUSTERED ( [FirstName] ASC, [LastName] ASC ) )";
SQL Data Servicesusing (SqlConnection conn = new SqlConnection(connStringBuilder.ToString())){ conn.Open(); using (SqlCommand cmd = conn.CreateCommand()) { cmd.CommandText = createTableSql; cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery();
cmd.CommandText = "select * from tbl_Person where FirstName = 'Dennis'"; using (SqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { Console.WriteLine("First Name: {0}", reader["FirstName"]); } reader.Close(); }}
SQL Data Services
OleDb
SQL Data Services
Tabular Data Stream
ADO.NETODBC
SQL Applications
Astoria&
Entity Framework
Java
PH
P
Ru
by
Oth
ers
.NET RIA SERVICES
Vision and goals
• Simplify RIA development– n-tier is hard, and un-natural
• Bring ASP.NET/RAD-style productivity to RIA development– Focus on end-to-end scenarios and solutions
End-to-End Data
• Beyond accessing and editing rows– App-specific custom operations– Data shaping (sorting, paging, filtering)– Rules (validation, authorization, conflict
handing)– Batching and offline
Multi tier application model
Web ApplicationBrowser Rich Internet Application
DB
Services
Other Applications
Data Access Layer
AppLogic
Services
HTMLPresentati
onLogic
Network
Services
DEMO
A Prescriptive Pattern
Application
DB
Services
Data Access Layer
AppLogic
Presentation
Logic
Network
DomainService: CRUD + App Logicclass CatalogIQueryable<Product> GetProducts()void UpdateProduct(Product, Product)void ToggleSale(Product)Validation and authorization rules, Application workflows, …
Data Model class Product
DomainContext: Bindable Dataclass CatalogEntityList<Product> Products { get }void LoadProducts(IQueryable<Product>)void ToggleSale(Product)
class ProductData members + Validationvoid ToggleSale()
Data Model +Metadata +
Shared Code
A Pattern that Scales and Grows
AppLogic
DatabasesADO.NET,ORMs (LTS, EF, …)
CLR Lists/ObjectsRepository(nHibernate, …)
ServicesREST/SOAP(Azure, …)
XML, JSON, Binary
Unit Test Code
What didn’t we cover?
• Authentication– Both Windows & Forms based
• Enhanced SEO capabilities– Not yet fully functional in current bits
• Business application template• Linq2Sql & Azure capabilities• OOB & Offline synchronization
Roadmap
• SQL Data Services– Unknown, only that it supports TDS
• .NET RIA Services– May CTP available, new one in July– PDC09 bits will run on Astoria– First part of 2010 : RTW
Summary
• .NET RIA Services offer– Better n-tier support– Rapid Application Development– A pattern that scales and grows– Services for additional features
And remember, this will run on SDS
questionsResources:• http://silverlight.net/• .NET RIA Services forums• http://bloggingabout.net/blogs/dennis/