accounting fulfillment service proxies models
TRANSCRIPT
![Page 1: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/1.jpg)
![Page 2: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/2.jpg)
Offline Microsoft Silverlight ApplicationsDEV339
Steve LaskerLead Program ManagerMicrosoft Silverlight
![Page 3: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/3.jpg)
Offline & Silverlight
Basics of enabling your app for offline scenariosSilverlight Implementation
![Page 4: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/4.jpg)
Recipe
Determining Online/Offline State Local Storage Defined Offline Operations Categorized Data How To Retrieve Data
Not just about services
Data via MessagingHow to Sync ChangesSaving
![Page 5: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/5.jpg)
Silverlight Application - MVVM
Accounting
Fulfillment
Views
View Models
ServiceProxies
Models
![Page 6: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/6.jpg)
Silverlight Offline Application
Local Storage
Accounting
Fulfillment
ServiceProxies
Views
View Models
Models
![Page 7: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/7.jpg)
demo
Determining Offline State
![Page 8: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/8.jpg)
return NetworkInterface.GetIsNetworkAvailable();
Determining Online/Offline State
Use: NetworkInterfaceWrap w/WorkOffline
Monitor NetworkAddressChanged Event
// Monitor Network Changes (Online/Offline)NetworkChange.NetworkAddressChanged += NetworkAddressChanged;…void NetworkAddressChanged(object sender, EventArgs e) { CheckOnlineState();}
private bool _isOnline;
public bool IsOnline { get { if (WorkOffline) return false; return NetworkInterface.GetIsNetworkAvailable(); }}private void CheckOnlineState() { if (IsOnline != _isOnline) { _isOnline = this.IsOnline; NotifyPropertyChanged("IsOnline"); }}
![Page 9: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/9.jpg)
Recipe
Determining Online/Offline State √Local Storage Defined Offline Operations Categorized Data How To Retrieve Data
Not just about services
Data via MessagingHow to Sync ChangesSaving
![Page 10: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/10.jpg)
Canonical RequirementsPersistence – survive app restartsIndexed – data grows quickly, need quick accessDisk Paging – Only pull what you need from diskRelationships & GraphsLocking – multi threaded/app accessTransactionsProgramming Model (T-SQL, LINQ, …)
Local Storage
Customer_IdNameAddress
CustomerVehicle_IdYearMakeModel
Vehicle
Claim_IdCustomer_IdVehicle_Id
Claim
HTML5
IndexDBWEB SQL Database
Too much to cover in this session
![Page 11: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/11.jpg)
Application Overview
demo
![Page 12: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/12.jpg)
Calendar of AppointmentsClaimsDamages
Upload Images, w/descriptions & vehicle location
ReportsVehiclesNewsBranch StylesHelp
Operations – What Should Work Offline?
![Page 13: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/13.jpg)
Offline Operations
Calendar of AppointmentsClaimsDamages
Upload Images, w/descriptions & vehicle location
ReportsVehiclesNewsBranch StylesHelp
![Page 14: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/14.jpg)
demo
Disabling Online Operations
![Page 15: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/15.jpg)
Check Point
Determining Online/Offline State √Local Storage √Defined Offline Operations √Categorized Data How To Retrieve Data
Not just about services
Data via MessagingHow to Sync ChangesSaving
![Page 16: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/16.jpg)
User/Branch Info
Branch_Id
Appointments & Claims
LookupsVehicle Info
StandardVehicleInfo
State*
BranchOffice
BranchStyles
Claim
ClaimStatus
Appointment
ClaimDamage
VehicleBodyType
StandardVehicleInfo
State*
BranchOffice
BranchStyles
Claim
ClaimStatus
Appointment
ClaimDamage
VehicleBodyType
Reference Data Typically cached in completeness
Activity Data Typically partitioned per user
Appraiser_Id
Categorize Your Data
UserInfoUserInfo
Partitioned Reference Data Cached for offlinePartitioned, per user
VehicleReferencePhoto
VehicleReferencePhoto
![Page 17: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/17.jpg)
How’d My Data Get Local
Passive CachingCache results as requested
Active CachingAlways work locallySync all changes
HybridActively cache Reference & Activity dataWhen online, request from remote
Passively cache results
![Page 18: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/18.jpg)
Entity Managerentity Manager
Silverlight Offline Application w/Messaging
Local Storage
Accounting
Fulfillment
ServiceProxies
Message
Views
View Models
Models
![Page 19: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/19.jpg)
entity Manager
public class GetAppointmentsMessage : Message {
Message Pipeline
ProcessMessage(Message message)
OnlineOperation(){ … }
ProcessMessageResults(List<MessageResult> messageResults) {MessageCompleted.Invoke(message);
}
OfflineOperation() { … }
Views
View Models OnEntityChanged(…)
![Page 20: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/20.jpg)
demo
Messaging Operations
![Page 21: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/21.jpg)
entity Manager
Sync Groups
Synching Local Data
Local Storage
Accounting
Fulfillment
ServiceProxies
Message
Views
View Models
Models
Reference Data
Activity Data
![Page 22: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/22.jpg)
Getting Deltas
ChallengeHow to manage changes for N users
SolutionsServer Side Tracking
Client asks for “my” changes?Simple for the client, hard for the server – scalability limits
Client Side TrackingClient asks give me changes since XA little more work for the client, but endless scale
![Page 23: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/23.jpg)
Anchor Based Changes
Client stores “Last Sync Time” for each collectionCreate “Sync Groups”
Group Collections / Sync Group
SyncGroup Frequency (TimeSpan)
Reference 24 hours
Activity 5 minutes
Entity SyncGroup Anchor
States Reference 5/1/11 7:00:00 AM UTC
ClaimStatus Reference 5/1/11 7:00:00 AM UTC
StandardVehicleInfo Reference 5/1/11 7:00:00 AM UTC
VehicleReferencePhoto Reference 5/1/11 7:32:05 AM UTC
Appointments Activity 5/16/11 8:08:15 AM UTC
Claims Activity 5/16/11 8:08:15 AM UTC
ClaimDamage Activity 5/16/11 8:08:15 AM UTC
![Page 24: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/24.jpg)
Deltas Include…
InsertsUpdatesDeletes
But, how do I get a delete, if it’s deleted?
Tombstones
![Page 25: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/25.jpg)
Tombstones???
Maintained by Database Triggers
Appointment Appointment_Tombstone
Appointment_IdAppraiser_IdDeletedDate
Appointment_IdAppraiser_IdCustomer_IdVehicle_Id…CreatedLastEdit
Claim
ClaimDamage
Claim_Tombstone
ClaimDamage_Tombstone
CREATE TRIGGER AdjusterAppointment_Delete_UpdateTombstone ON AdjusterAppointment AFTER DELETEAS INSERT INTO AdjusterAppointment_Tombstone ( AdjusterAppointmentGuid, Adjuster_Id ) SELECT AppointmentGuid, Adjuster_Id FROM deleted
![Page 26: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/26.jpg)
demo
Getting Deltas
![Page 27: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/27.jpg)
Check Point
Determining Online/Offline State √Defined Offline Operations √Categorized Data Local Storage √How To Retrieve Data √
Not just about services
Data via Messaging √How to Sync Changes √Saving
![Page 28: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/28.jpg)
Saving
Save LocallySync w/Server
Just another message
![Page 29: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/29.jpg)
demo
Saving
![Page 30: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/30.jpg)
entity Manager
Sync Groups
Offline Silverlight Application w/Messaging
Local Storage
Accounting
Fulfillment
ServiceProxies
Message
Views
View Models
Models
Reference Data
Activity Data
![Page 31: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/31.jpg)
Check Point
Determining Online/Offline State √Defined Offline Operations √Categorized Data √Local Storage √How To Retrieve Data √
Not just about services
Data via Messaging √How to Sync Changes √Saving √
![Page 32: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/32.jpg)
Summary
Network resiliency doesn’t happen as an afterthoughtBuilding resilient applications is the future, not a stop gap
It’s how all important resources are managed
Design your apps to work offline from the beginningWhen things are connected, they work greatWhen “stuff” happens, your business continues to function
Contribute to usability & business stability
![Page 33: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/33.jpg)
Hands On Labs
DEV386HOL: Microsoft Silverlight Data BindingDEV388HOL: Web Services and Microsoft SilverlightDEV389HOL: Using WCF RIA ServicesDEV390HOL: Using the MVVM Pattern in Microsoft Silverlight Applications
Find Me Later At the Silverlight Boothhttp://Blogs.MSDN.com/SteveLasker
![Page 34: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/34.jpg)
Related Sessions
DEV330: Delivering End-End Video Workflow Using Microsoft SharePoint, IIS Media Services,Microsoft Expression Encoder and Microsoft Silverlight
DEV340: Tackle the Complexity of Async Calls in Microsoft Silverlight and WPF ClientsDEV209: From Zero to Silverlight in 75 MinutesDEV331: A Lap around Microsoft Silverlight 5DEV210: Microsoft Silverlight, WCF RIA Services and Your Business ObjectsDEV339: Offline Microsoft Silverlight ApplicationsDEV337: Moving Your App and Skills from Windows Forms to Microsoft Silverlight (and WPF)DEV356: Integrating Security Roles into Microsoft Silverlight Applications
http://Silverlight.net Find Me Later At the Silverlight Boothhttp://Blogs.MSDN.com/SteveLasker http://SLOfflineDemo.codeplex.com/
![Page 35: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/35.jpg)
Complete an evaluation on CommNet and enter to win!
![Page 36: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/36.jpg)
Related Sessions
DEV330: Delivering End-End Video Workflow Using Microsoft SharePoint, IIS Media Services,Microsoft Expression Encoder and Microsoft Silverlight
DEV340: Tackle the Complexity of Async Calls in Microsoft Silverlight and WPF ClientsDEV209: From Zero to Silverlight in 75 MinutesDEV331: A Lap around Microsoft Silverlight 5DEV210: Microsoft Silverlight, WCF RIA Services and Your Business ObjectsDEV339: Offline Microsoft Silverlight ApplicationsDEV337: Moving Your App and Skills from Windows Forms to Microsoft Silverlight (and WPF)DEV356: Integrating Security Roles into Microsoft Silverlight Applications
http://Silverlight.net Find Me Later At the Silverlight Boothhttp://Blogs.MSDN.com/SteveLasker http://SLOfflineDemo.codeplex.com/
![Page 37: Accounting Fulfillment Service Proxies Models](https://reader037.vdocuments.net/reader037/viewer/2022103101/56649ea85503460f94bac544/html5/thumbnails/37.jpg)
© 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to
be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS
PRESENTATION.