occasionally connected smart clientsprs034 steve lasker program manager microsoft corporation
TRANSCRIPT
Occasionally Connected Occasionally Connected Smart ClientsSmart ClientsPRS034PRS034
Steve LaskerSteve LaskerProgram ManagerProgram ManagerMicrosoft Microsoft CorporationCorporation
2
AgendaAgenda
Resources for working offlineResources for working offline
Occasionally Connected Systems Occasionally Connected Systems Common ArchitectureCommon Architecture
Demo ScenarioDemo Scenario
Demo ArchitectureDemo ArchitectureEmbedded/Local Database OptionsEmbedded/Local Database Options
Sync OptionsSync Options
Application UpdatesApplication Updates
Running Background Tasks Running Background Tasks Asynchronously Asynchronously
3
What is: Occasionally What is: Occasionally ConnectedConnectedEmpowering users to leverage their Empowering users to leverage their computer, applications, data and files computer, applications, data and files regardless of network availabilityregardless of network availability
Application proactively retrieves necessary Application proactively retrieves necessary data necessary to work offlinedata necessary to work offline
As the network comes available, the As the network comes available, the application will automatically sync their work application will automatically sync their work and log conflicts for the user to resolveand log conflicts for the user to resolve
Network operations occur in the background Network operations occur in the background so the user can stay focused on their taskso the user can stay focused on their task
Example: Outlook 2003Example: Outlook 2003
4
Resources needed offlineResources needed offline
DataDataA subset of the data from the server(s)A subset of the data from the server(s)
Heterogeneous Sync (SQL, Oracle, DB2, …)Heterogeneous Sync (SQL, Oracle, DB2, …)
FilesFilesNot all data exists within the databaseNot all data exists within the database
Media files, Office Files, …Media files, Office Files, …
Application Messaging (Web Services, Application Messaging (Web Services, Indigo, …)Indigo, …)
Ability to queue outbound messagesAbility to queue outbound messages
Ability to async process inbound messagesAbility to async process inbound messages
Read Only Informational/Reference Data Read Only Informational/Reference Data ServicesServices
Ability to pre-fetch data from existing servicesAbility to pre-fetch data from existing services
5
Occasionally Connected Smart ClientOccasionally Connected Smart Client
Background Background TasksTasks
OCS ComponentsOCS ComponentsN
etw
ork
Resou
rces
Netw
ork
Resou
rces Data SyncData Sync
ServicesServices
Embedded APIEmbedded API
Embedded Embedded Data StoreData Store
Message Message QueuingQueuing
Message Message CachingCaching
FilesFiles
File SyncFile SyncServicesServices
Microsoft Windows / Windows MobileMicrosoft Windows / Windows Mobile
Vis
ual S
tud
ioV
isu
al S
tud
io
Smart Client Application / UISmart Client Application / UI
Application Application UpdatesUpdates
Canned Canned UI UI
ControlsControls
6
Data Center Smart Client
Sales
Fulfillment
Inventory
Logi
c
LogicRules
LogicRules
LogicRules
EmbeddedData Store
Rules
UI
Logic
Occasionally Connected Occasionally Connected ArchitectureArchitecture
Logic
Sync
Transport
Logic
Netw
ork
Resou
rces
Netw
ork
Resou
rces
Backg
rou
nd
Tasks
Backg
rou
nd
Tasks
SyncClient
IndigoC
acheIndigoQ
ueue
AppUpdates
Acc
ounti
ng
AppDeployment
FilesFiles
7
Adventure Works SalesAdventure Works Sales
Field SalesField SalesMulti-level marketingMulti-level marketing
Consumers sell Adventure Works Consumers sell Adventure Works ProductsProductsNeed for the app to run disconnectedNeed for the app to run disconnectedSellers are independentSellers are independent
Hardware not owned by Adventure WorksHardware not owned by Adventure Works
Many platformsMany platformsBrowserBrowserDesktopDesktopTablet PCTablet PCPocket PCPocket PCSmart PhoneSmart Phone
8
AdventureWorks Sales AppAdventureWorks Sales App
9
Adventure Works SalesAdventure Works SalesSmart ClientSmart Client
Background Background TasksTasks
Adventure Adventure Works CorpWorks Corp
Adventure Works Sales Adventure Works Sales ArchitectureArchitecture
Netw
ork
Serv
ices
Netw
ork
Serv
ices
SyncSyncServicesServices
EmbeddedEmbeddedData StoreData Store
WeatherWeatherCachingCaching
Order Order SubmissioSubmission Queuen Queue PromoPromo
VideosVideos
App LogicApp Logic
Desktop Desktop TabletPTabletP
CCPocketPCPocketPC Smart Smart
PhonePhone
DataDataServerServer
Syn
cS
yn
cS
erv
icS
erv
ices
es
Ord
er
Ord
er
Serv
icS
erv
ices
es
WeatheWeatherr
ServiceServicess
•Product Product CatalogCatalog•My CustomersMy Customers•Order Order ScratchpadScratchpad•My InventoryMy Inventory
App App UpdatesUpdates
10
Which local data store?Which local data store?
MS Database Technologies MS Database Technologies SQL Server 2005SQL Server 2005
SQL Workgroup 2005SQL Workgroup 2005
SQL Express 2005SQL Express 2005
SQL Mobile 2005SQL Mobile 2005Jet Jet (Access)(Access)
FoxFox
ExcelExcel
XMLXML
Something newSomething new
11
Occasionally Connected Occasionally Connected DevicesDevices
ServersServers
DesktopsDesktops
LaptopsLaptops
Tablet PC’sTablet PC’s
Windows CEWindows CE
Pocket PCPocket PC
Smart PhoneSmart Phone
??
Win 32Win 32Sweet Sweet spotspot
12
Local Database OptionsLocal Database Options
Server (1000’s of users)
Workgroup (Dozens of users)
Desktop (Single User)
Laptop
Tablet PC
Windows CE Device
Pocket PC
Smart Phone
Win 32Win 32
SQ
L M
ob
ile S
QL
Exp
ress
SQ
LS
erv
er
Mu
ltiU
ser
Sin
gle
Use
r S
cena
rios
13
SQL Express w/SyncSQL Express w/Sync
SQL Express now has User Instance SQL Express now has User Instance featuresfeatures
Great for VS DevelopmentGreat for VS Development
Connect w/File Path Connection StringConnect w/File Path Connection String
Merge Replication not supported Merge Replication not supported w/User Instancesw/User Instances
14
Deploying SQL Express for Deploying SQL Express for OCSOCS
Add DBO Privileged AccountAdd DBO Privileged Account
Script creation of databaseScript creation of database
Verify / Create / Attach database at Verify / Create / Attach database at startupstartup
Deploy SQL Replication .DllsDeploy SQL Replication .Dlls
15
Configuring SQL Express Configuring SQL Express w/Merge Replw/Merge Repl
16
Deploying SQL MobileDeploying SQL Mobile
SqlMobile Engine:SqlMobile Engine:Add runtime dlls to project (sqlce*.dll) Add runtime dlls to project (sqlce*.dll) C:\Program Files\Microsoft Visual Studio 8\Common7\IDEC:\Program Files\Microsoft Visual Studio 8\Common7\IDE
Set files to Set files to Copy to Output Directory = Copy if newerCopy to Output Directory = Copy if newer
ADO for SqlMobile:ADO for SqlMobile:Add reference to Microsoft SQL Mobile Add reference to Microsoft SQL Mobile
Located in: Located in: C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PublicAssemblies\System.Data.SqlServerCE.dllPublicAssemblies\System.Data.SqlServerCE.dll
17
Deploying SQL MobileDeploying SQL Mobile
18
How - To Cache How - To Cache
Roll your ownRoll your ownUltimate in flexibilityUltimate in flexibilityHighest cost to develop and maintainHighest cost to develop and maintain
RDARDAEasy entry point for well partitioned data, no config to databaseEasy entry point for well partitioned data, no config to databaseLimited to SQL MobileLimited to SQL Mobile
Merge ReplicationMerge ReplicationMost power, broadest features for different data partitions, spans all devicesMost power, broadest features for different data partitions, spans all devicesNeed DBO/DBA privileges, must “own” serverNeed DBO/DBA privileges, must “own” server
Transactional ReplicationTransactional ReplicationPrimarily targeted towards server to server replication scenarios. Primarily targeted towards server to server replication scenarios. Good for regional distribution but not great for occasionally connected scenariosGood for regional distribution but not great for occasionally connected scenarios
TechnologyTechnology Roll your Roll your ownown RDARDA
MergeMerge
ReplicatioReplicationn
TransactionalTransactional
ReplicationReplication
XML - DataSetsXML - DataSets SQL ExpressSQL Express SQL MobileSQL Mobile
19
Configuring Merge Configuring Merge ReplicationReplication
20
Remote Data Access (RDA)Remote Data Access (RDA)
21
App Updates w/ClickOnceApp Updates w/ClickOnce
ClickOnce Background API’sClickOnce Background API’s
Imports System.Deployment.Application.ApplicationDeployment…CurrentDeployment.Update()
22
App Updates - ClickOnceApp Updates - ClickOnce
23
Background TasksBackground Tasks
Code running on background threadsCode running on background threads
Watching for Network ResourcesWatching for Network ResourcesSending OrdersSending Orders
Looking to syncLooking to sync
Pre-Fetching Weather InformationPre-Fetching Weather Information
24
Background TasksBackground Tasks
26
ResourcesResources
Data Designers & Occasionally Connected Systems Discussions:http://blogs.msdn.com/SmartClientData
Data Runtime:http://msdn.Microsoft.com/Data/
Windows Forms: http://www.WindowsForms.net
Patterns & Practices: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/SCAG.asp
27
Community ResourcesCommunity ResourcesAt PDCAt PDC
For more information, go seeFor more information, go seeTue 1pm & 4:15pm PRS402 Tue 1pm & 4:15pm PRS402 Windows Forms: Harnessing the Power and Flexibility Windows Forms: Harnessing the Power and Flexibility of Windows Forms 2.0of Windows Forms 2.0Thur 11:30am PRS321Thur 11:30am PRS321Windows Forms: Integrating Windows Forms and Windows Windows Forms: Integrating Windows Forms and Windows Presentation Foundation ("Avalon")Presentation Foundation ("Avalon")Fri 1pm FUN222Fri 1pm FUN222Windows Vista: What’s New in Software Installation for Windows Vista: What’s New in Software Installation for Windows Vista: Exploring the Windows Installer (MSI) and Windows Vista: Exploring the Windows Installer (MSI) and ClickOnce OptionsClickOnce OptionsLabs: Labs:
FUNHOL15 ClickOnce Deployment FUNHOL15 ClickOnce Deployment PRSHOL17 New UI Features in Windows Forms PRSHOL17 New UI Features in Windows Forms PRSHOL18 New Data Features in Windows Forms PRSHOL18 New Data Features in Windows Forms PRSHOL19 Windows Forms: Advanced Layout PRSHOL19 Windows Forms: Advanced Layout
Ask The ExpertsAsk The Experts
After PDCAfter PDCMSDN dev center: MSDN dev center: http://msdn.microsoft.com/windowsforms/http://msdn.microsoft.com/windowsforms/MSDN Forums: MSDN Forums: http://forums.microsoft.com/msdn/default.aspx?http://forums.microsoft.com/msdn/default.aspx?ForumGroupID=2 ForumGroupID=2
28
Questions, Contact, and More Questions, Contact, and More InfoInfo
[email protected]@Microsoft.com
http://blogs.msdn.com/http://blogs.msdn.com/SmartClientDataSmartClientData
© 2005 Microsoft Corporation. All rights reserved.This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
30
Existing ArchitecturesExisting Architectures
31
Local Data App
UI
Standalone Application Standalone Application EvolutionEvolution
Validation Logic
LocalDatabase
DAL
CentralDatabase
32
Data Island Data Island Shared Shared DataData
Users lose offline functionalityUsers lose offline functionality
Applications aren’t typically written Applications aren’t typically written with multi-user in mindwith multi-user in mind
Rearchitecture typically required to Rearchitecture typically required to make multi-usermake multi-user
33
Smart Client
Sales
Fulfillment
Accounting
Inventory
Logic
Web S
ervice
Logic
LogicRules
LogicRules
LogicRules
DataSets over Web DataSets over Web ServicesServices
Web S
erviceC
lient
Controls
Validation Logic*
CustomersCustomers
XMLXML
OrdersOrders
XMLXML
SELECT *SELECT *FROM CustomersFROM Customers
34
DataSet CachingDataSet Caching
Excellent for serialization and change Excellent for serialization and change trackingtracking
Contain different views of the same dataContain different views of the same data
Storage is based on XML / BinaryStorage is based on XML / BinaryQuerying requires loading the entire dataset Querying requires loading the entire dataset into memory *into memory *
Updating the local dataset requires loading the Updating the local dataset requires loading the entire dataset into memory entire dataset into memory
Transaction support *Transaction support *
Query processor *Query processor *
No canned, E2E, sync technologyNo canned, E2E, sync technologyHas change tracking w/DataAdaptersHas change tracking w/DataAdapters
XML DiffGram basedXML DiffGram based
35
Smart Client
Service
Cache
Sales
Fulfillment
Accounting
Inventory
Logic
Service
Logic
LogicRules
LogicRules
LogicRules
Message Based Queuing / Message Based Queuing / CachingCaching
ServiceC
lient
Controls
Validation Logic*
CustomersCustomersOrdersOrders
SELECT *SELECT *FROM CustomersFROM Customers
36
Message Based CachingMessage Based Caching
Similar to DataSet CachingSimilar to DataSet Caching
Blobs are now stored in queuesBlobs are now stored in queues
No ability to query on uncommitted No ability to query on uncommitted datadata
37
Logical QueuingLogical Queuing
Sending mail in outlookSending mail in outlookPressing send a little too quicklyPressing send a little too quickly
Submitting Expense ReportsSubmitting Expense ReportsFound a receipt in the bottom of your Found a receipt in the bottom of your bagbag
38
Logical QueuingLogical Queuing
39
Sync ComponentsSync Components
Occasionally Connected Systems ServicesOccasionally Connected Systems Services
Sync GroupsSync Groups
Sync Group ItemsSync Group Items
File File ItemsItems
DatabasDatabase Itemse Items
Message Message ItemsItems
Message Message Pre-Pre-
Fetch Fetch ItemsItems
App App Update Update ItemsItems