1 / 32

Occasionally Connected Smart Clients

Occasionally Connected Smart Clients . Steve Lasker Program Manager Visual Studio Microsoft Corporation Steve.Lasker@Microsoft.com blogs.msdn.com/SmartClientData. What Is: Occasionally Connected.

zurina
Download Presentation

Occasionally Connected Smart Clients

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Occasionally Connected Smart Clients Steve Lasker Program Manager Visual Studio Microsoft Corporation Steve.Lasker@Microsoft.com blogs.msdn.com/SmartClientData

  2. What Is: Occasionally Connected • Empowering users to leverage their computer, applications, data and files regardless of network availability • Application proactively retrieves necessary data necessary to work offline • As the network comes available, the application will automatically sync their work and log conflicts for the user to resolve • Network operations occur in the background so the user can stay focused on their task • Example: Outlook 2003

  3. Agenda • Resources for working offline • Occasionally Connected Systems Common Architecture • Demo Scenario • Demo Architecture • Database Options • Sync Options • Application Updates • Running Background Tasks Asynchronously

  4. Resources Needed Offline • Data • A subset of the data from the server(s) • Heterogeneous Sync (SQL Server, Oracle, DB2, …) • Files • Not all data exists within the database • Media files, Office Files, … • Application Messaging (Web Services, WCF, …) • Ability to queue outbound messages • Ability to async process inbound messages • Read Only Informational/Reference Data Services • Ability to pre-fetch data from existing services

  5. Visual Studio Microsoft Windows / Windows Mobile Occasionally Connected Smart Client Smart Client Application / UI Background Tasks Canned UI Controls Data Sync Services File Sync Services Data Access API Network Resources Message Queuing Message Caching Data Store Files Application Updates

  6. Adventure Works Sales • Field Sales • Multi-level marketing • Consumers sell Adventure Works Products • Need for the app to run disconnected • Sellers are independent • Hardware not owned by Adventure Works • Many platforms • Browser • Desktop • Tablet PC • Pocket PC • Smart Phone

  7. Adventure Works Sales Architecture Weather Services Adventure Works Corp Adventure Works Sales Smart Client Background Tasks Desktop TabletPC PocketPC Smart Phone Sync Services Sync Services App Logic Data Server Weather Caching Data Store Network Services Order Services Order Submission Queue PromoVideos • Product Catalog • My Customers • Order Scratchpad • My Inventory App Updates

  8. Which Local Data Store? Microsoft Database Technologies • SQL Server 2005 • SQL Server Express Edition • SQL Server Mobile Edition • Jet (Access) • Microsoft Visual FoxPro (.dbf) • Excel • XML • WinFS • Something new

  9. SQL Server Express • Great improvements over MSDE • Simple install from web or local MSI • ClickOnce will BootStrap SSE if not installed • Connect w/File Path Connection String • User Instance feature for File Path Connecitons • Great for VS Development

  10. Deploying SSE For Occasionally Connected Scenarios • Base Install of SSE • ClickOnce Bootstrapper • Requires Admin Rights • Replication w/SSE • Replication not supported w/User Instances • Enable SQL Server Authentication • Add DBO Privileged Account • Script creation of database • Verify / Create / Attach database at startup • Deploy SQL Server Replication .Dlls

  11. Occasionally Connected Devices • Servers • Desktops • Laptops • Tablet PC’s • Windows CE • Pocket PC • Smart Phone ? Sweet spot Win 32

  12. MultiUser Single User Scenarios Local Database Options Server SQLServer Workgroup Desktop SQL ServerExpress Laptop Tablet PC Win 32 Windows CE Device SQL Mobile SQL Mobile Pocket PC Smart Phone

  13. Deploying SQL Server Mobile • SQL Server Mobile Engine • Add runtime dlls to project (sqlce*.dll) C:\Program Files\Microsoft Visual Studio 8\Common7\IDE • File size <1.4mb • Set files to Copy to Output Directory = Copy if newer • ADO for SQL Server Mobile • Add reference to Microsoft SQL Mobile • Located in: C:\Program Files\Microsoft Visual Studio 8\ _ Common7\IDE\PublicAssemblies\System.Data.SqlServerCE.dll • File Size ~224k

  14. Deploying SQL Server Mobile

  15. SQL Server Mobile Runtime

  16. How - To Sync • Roll your own • Ultimate in flexibility • Highest cost to develop and maintain • Merge Replication • Most power, broadest features for different data partitions, spans all devices • Need DBO/DBA privileges, must “own” server • Remote Data Access (RDA) • Easy entry point for well partitioned data, no config to database • Limited to SQL Server Mobile

  17. RDA Sync Architecture Local App UI IIS w / Sync ISAPI dll Server Data DAL RDA Sync Engine Out In Database Engine SQL Server Mobile

  18. RDA: Initializing Reference Data • RDA.Pull(“Products", _ • "SELECT ProductId, Name, Description, Category, UnitPrice " & _ • "FROM Products", _ • My.Settings.ServerOleDBConnectionString, _ • RdaTrackOption.TrackingOff) Reference Data Product Catalog

  19. RDA: Initializing Updatable Data • Rda.Pull(“Customers", _ • "SELECT CustomerId, Name, Address, Phone, Fax" & _ • "FROM Customers", _ • My.Settings.ServerOleDbConnectionString, _ • RdaTrackOption.TrackingOn) Updateable Data Customers

  20. RDA: Pushing Changes Back • Rda.Push(“Customers", _ • My.Settings.ServerOleDbConnectionString, _ • SyncBatching.BatchingOn) Updateable Data Customers In

  21. Incorporating WCF w/RDA Smart Client Accounting Transport Logic Controls WCF Queue Validation Logic* Transport Sales Logic Logic Rules WCF Cache Inventory Logic Logic Rules Rules Local Data Store Sync Client Fulfillment Sync Logic Rules

  22. Remote Data Access (RDA)

  23. Configuring RDA • Configure Web Sync Point • Write client side code • Dim rda AsNew SqlCeRemoteDataAccess() • rda.InternetUrl = "http://www.YourCompany.com/SqlMobileSync/sqlcesa30.dll" • rda.LocalConnectionString = "Data Source =.\AdventureWorksSales.sdf" • rda.Pull("LocalTableName", _ • "Query To Execture on the Server", _ • "OLEDB ConnectionString from Web Server to SQL Server", _ • RdaTrackOption.TrackingOnWithIndexes, _ • "Local Table for Errors on Push") • Dim rda AsNew SqlCeRemoteDataAccess() • rda.InternetUrl = "http://www.YourCompany.com/SqlMobileSync/sqlcesa30.dll" • rda.LocalConnectionString = "Data Source =.\AdventureWorksSales.sdf" • rda.Pull("Customer", _ • "SELECT CustomerID, Name, FROM Customer ", _ • "Provider=SQLOLEDB.1;Data Source=YourSQLServer;" & _ • "User ID=YourServerUserName;Password=YourServerPassword;" & _ • "Initial Catalog=AdventureWorksSales", _ • RdaTrackOption.TrackingOnWithIndexes, _ • "Customer_Errors")

  24. RDA Limitations • Based on Snapshot  Push, Push, Push • Changes at server aren’t pulled down until next snapshot • Limits the Product Catalog scenarios • Updates are limited to last client wins • Comparison based on PK only

  25. App Updates With ClickOnce • ClickOnce Background API’s • Imports System.Deployment.Application.ApplicationDeployment • ... • Private Function CheckForAppUpdates() As UpdateCheckInfo • If ApplicationDeployment.IsNetworkDeployed Then • Dim updateInfo As UpdateCheckInfo • updateInfo = CurrentDeployment.CheckForDetailedUpdate() • If updateInfo.UpdateAvailable Then • ' download the update • If ApplicationDeployment.CurrentDeployment.Update() Then • ' Update Downloaded • EndIf • EndIf • Return updateInfo • EndIf • End Function

  26. App Updates - ClickOnce

  27. BackgroundTasks / Steps • Runs on a background thread of the application • Executes collection of steps • Start / Stop similar to Windows Services • Executes in a loop based on a Timer • Can be triggered by Network Resources • Marshals progress / completed infoto UI thread

  28. Background Tasks

  29. Summary • Smart Client Advantages • Ability to work offline • Ability to work on behalf of the user • Leverage, embrace reference data • Leverage Microsoft local data stores • SQL Server Express Edition • SQL Server Mobile Edition • Build sync APIs as background tasks • Composable Sync APIs are coming… • Leverage Occasionally Connected Systems Architectures to be well positioned • Leverage ClickOnce APIs for updates

  30. Data Designers & Occasionally Connected Systems Discussions:http://blogs.msdn.com/SmartClientData Drag Once Databinding:http://www.Code-Magazine.com/Article.aspx?quickid=0409051 Drag Once w/Custom Controls:http://www.Code-Magazine.com/Article.aspx?quickid=0411071 Windows Forms: http://www.WindowsForms.nethttp://msdn.Microsoft.com/WindowsForms/http://forums.Microsoft.com/msdn/default.aspx?ForumGroupID=2 Data Runtime:http://msdn.Microsoft.com/Data/ Patterns & Practices: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/SCAG.asp Resources

  31. Community Resources • At PDC • For more information, go see • Wed 1pm & 3:15pm PRS402 Erik EllisHarnessing the Power and Flexibility of Windows Forms 2.0 • Thur 11:30am PRS321 Mark BoulterWindows Forms: Integrating Windows Forms and Windows Presentation Foundation ("Avalon") • Fri 10:30am PRS334 Chris Sells, Doug PurdyWindows Presentation Foundation ("Avalon") + Windows Communications Foundation ("Indigo") = Magic • Fri 1pm FUN222 Jamie CoolWhat’s New in Software Installation for Windows Vista: Exploring the Windows Installer (MSI) and ClickOnce Options • Labs: • FUNHOL15 ClickOnce Deployment • PRSHOL17 New UI Features in Windows Forms • PRSHOL18 New Data Features in Windows Forms • PRSHOL19 Windows Forms: Advanced Layout • Ask The Experts

  32. © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

More Related