Presentation is loading. Please wait.

Presentation is loading. Please wait.

Anywhere Access to Data Markus Egger President, EPS Software Corp. Publisher, CoDe Magazine.

Similar presentations


Presentation on theme: "Anywhere Access to Data Markus Egger President, EPS Software Corp. Publisher, CoDe Magazine."— Presentation transcript:

1 Anywhere Access to Data Markus Egger President, EPS Software Corp. Publisher, CoDe Magazine

2 About Me… Markus Egger President and Chief Software Architect EPS Software Corp. President and Chief Software Architect EPS Software Corp. Publisher: CoDe and CoDe Focus Magazines International Author and Speaker Microsoft MVP: C# Tablet PC “Influential”

3 Today’s Agenda Accessing File-Based Data Synchronization Manager for Offline Data Data Access Scenarios Data Access Architecture for “Anywhere Access” Accessing Data in Databases Client-Side Caching Service Oriented Architecture SQL Server and SQL CE ADO.NET

4 Accessing File-Based Data Markus Egger EPS Software Corp. CoDe Magazine markus@eps-software.com

5 File-Based Data Scenarios “File-based” almost always means accessing files either on a local drive or on a local network share. Note: Technologies for distributed file access are available (and can be implemented manually), but we are not concerned with these technologies in this talk. For distributed scenarios, files generally have to be “synchronized” for offline consumption. Microsoft provides everything needed for offline file caching and synchronization on computers as well as mobile devices.

6 Synchronization Manager Centralized, standard technology for synchronizing files for offline use. Files are synchronized independently of the protocol. Intended for applications that run primarily on mobile computers. This technology is not just for files! More about that later…

7 Mobile Computing Configurations Synchronization Manager is useful for computers configured as follows: Mobile computer in docking station but occasionally used over a dial-in connection. Mobile computer used mostly over a dial-in connection. Desktop computer used strictly over a dial-in connection, such as a computer used by a telecommuter. Desktop computer used strictly over a high bandwidth network.

8 Application Scenarios for Synch Manager Microsoft Office applications that need to prepare files for offline use. Client-side caching that lets you cache files locally. Browsers that can cache HTML pages locally. Mail programs that can cache e-mail messages locally. Databases that can store information locally.

9 Synchronization Manager Architecture End user can: Schedule applications for synchronization. Set up automatic synchronization to occur in conjunction with specified system events. Programming interface can: Enable applications to register for synchronization features. Process errors. Receive progress information and notifications during the synchronization process.

10

11 Programmable Interface To use the Synchronization Manager programmatically, you must implement COM interfaces Your object must implement: ISyncMgrSynchronizeISyncMgrEnumItems SyncMgr implements: ISyncMgrSynchronizeCallbackISyncMgrSynchronizeInvoke

12 Longhorn Application Sync Centralized and consistent sync experience for applications, services, and devices. Users are in control. Clear what is being synchronized to and from the computer. Consistent experience for status, errors, and conflicts. Frequent synchronization tasks at most two clicks away. Synchronization is not obtrusive.

13 XP Sync Man Longhorn Synchronization Manager

14 Database Scenarios Markus Egger EPS Software Corp. CoDe Magazine markus@eps-software.com

15 Data Access Scenarios Applications must work well in LAN scenarios. Basically, all types of applications support basic networking. Applications must work in distributed scenarios. ASP.NET Web applications are an obvious choice here. Smart Client applications now also work well over protocols such as HTTP. Applications must work in disconnected or partially connected scenarios. Smart Client applications (running on various devices or operating systems) are the only choice here.

16 Data Access Goals Top priority: Create an application that can be used anywhere and any time. Create an architecture that can be used in many scenarios and over an extensive period of time. The architecture needs to be OS-independent and device-independent. The architecture should carry us well into new operating systems and device generations. Applications should also support flexible deployment scenarios.

17 Therefore: Smart Clients Rule! Smart Client applications cover all the different scenarios and goals. Smart Client applications are great for “known permanent users”. These are users that are known to us and use our application extensively. We may supplement Smart Clients with HTML-based Web applications. These are great for “occasional users” and “public users”. We need to make sure our data access strategy works well in this scenario too.

18 Architectural Overview Database (SQL Server) Business Logic (“The App”) User Interf. Service Interface

19 Core Application Architecture = Deployment Boundary

20 Data Access Architectural Goals Disconnected from database Flexible access to different back ends Automatic failover when needed Simple usage approach (for developers) Easy to extend

21 Data Access Architecture Note: A production implementation will probably feature a lot more methods.

22 Implementing the Data Service Markus Egger EPS Software Corp. CoDe Magazine markus@eps-software.com

23 Data Service Recap Abstracted object that takes care of the details of talking to a database Instantiated by a Factory object Can be extended through fundamental interface (IDataService)

24 Business Object Architectural Goals Scalability Database Independence Simple to Use Simple to Program StatelessReusable

25 Business Object Architecture +Business Object GetList( ) Verify( ) Save( ) GetSingleRecordByPK( ) $GetInstance( ) +IBusinessObject GetList( ) Verify( ) Save( ) GetSingleRecordByPK( ) +CustomerBO +GetCustomersByCompanyName( ) +OrderBO GetOrdersByCustomerID( ) +XyzBO

26 Implementing the Business Object Markus Egger EPS Software Corp. CoDe Magazine markus@eps-software.com

27 Business Object Recap A fundamental business object (BO) implementation provides default functionality. New BOs can be easily created by subclassing the base implementation. A generic interface provides great flexibility. Static GetInstance() helper provides great deployment flexibility. Abstract away all access to the data layer!

28 Related Topics Security refresher SQL Injection! Use Stored Procedures and Parameters! Execution rights and CAS Make sure your distributed access is secure Replay attacks, data interception, command interception, data tampering, …

29 Related Topic: DataSets Topic of heated discussion… ;-) DataSets provide lots of functionality, but: They are not always efficient. Think, for example, of serialization. Who knows? They might change in the future. Strongly typed DataSets provide type- safety and compile-time verification.

30 DataSets (continued) Custom data objects can be strongly typed and more efficient, but they are more work. Custom data objects provide full control (for the developer) and independence from potential.NET Framework changes My recommendation: combine the two approaches! Create a custom wrapper for DataSets. Wrappers provides strong typing and other functionality. Since the DataSet is not exposed, you can always change these implementation details.

31 Implementation Details Markus Egger EPS Software Corp. CoDe Magazine markus@eps-software.com

32 Different Data Services LAN data services simply access local database instances and servers. Distributed data services perform the same basic task, but have to use “in between” technologies: Web Services Remoting Isn’t that outdated? No, not really, but it needs to be handled as a “replaceable” technology. Microsoft Code Name “Indigo”

33 Different Data Services (cont.) Offline Data Needs to store data in a local database such as MSDE or SQL CE. XML can be used as a “poor man’s database”. Offline copies of data can be created automatically when data is accessed. The Synchronization Manager can be used to trigger and handle synchronization.

34 Offline Update Scenarios Upload scenarios can get tricky! Database applications tend to be more interconnected than applications such as Outlook. Example: Updating one item (address) can change other data (shipping fee on an unprocessed invoice).

35 Offline Update Scenarios (cont.) Often, local data needs to duplicate almost all server-side structures and referential integrity as well as business rules (checks and processing). Sometimes additional consideration needs to be given to business scenarios that are unique to the offline-cache situation. Applications may need to handle a special “unprocessed” state for items that may still have to change or may not yet have triggered other actions.

36 Case Study: Outlook 2003 Markus Egger EPS Software Corp. CoDe Magazine markus@eps-software.com

37 Outlook 2003 Major re-write of the application Builds on: Cached Exchange Improved Synchronization Conflict Resolution RPC over HTTP PST/OST Enhancements

38 Cached Mode: Shields Users From Network Conditions Outlook runs against a local copy of the user’s mailbox (OST). Uses the Offline Address Book (OAB) for basic addressing functions. The OST and OAB are automatically kept in sync with server. Classic “Online” features are available (Calendaring, Public Folders, Delegate Access).

39 Cached Mode: Uses Improved Synchronization Fewer bytes over the wire and less roundtrips Bi-directional data compression Increased buffer sizes Partial item upload These changes plus others yielded 50% reduction in BoW More robust synchronization Check-pointing Skip bad item Deliver most important data first Synchronizations initiated on user navigation Most recent items first (LIFO) within a folder

40 Cached Mode: Handles Connectivity Changes Outlook just keeps working when the network goes away. Few annoying error messages User’s data is available User can create new items and modify existing items Outlook automatically re-connects to the Exchange server.

41 Cached Mode: Bandwidth Aware On fast networks: Downloads full items on all folders and address book updates. On slow networks ( < 128 Kb): Synchronizes only “headers” on all folders. Headers small but contain sufficient information to render views. Users can triage their mail – download important messages and delete junk mail.

42 Questions? Feel free to send me email! Markus Egger EPS Software Corp. CoDe Magazine markus@eps-software.com

43 MEDC Mobile PC Talks CLI204 - Tablet PC Development Overview Speaker - Dave Hale Time – Tuesday 5/10 11:30 AM CLI208 – Anywhere Access to Data Speaker – Markus Egger Time – Tuesday 5/10 3:00 PM CLI324 - Advanced Tablet PC Development Topics Speaker – Todd Landstad Time – Wednesday 5/11 8:00 AM CLI325 - In Depth - Ink Data Management Speaker – Stefan Wick Time – Wednesday 5/11 9:30 AM CLI329 - Network Awareness Speaker – Dr. Neil Roodyn Time – Thursday 5/12 8:00 AM

44 Mobile Hands On Labs at MEDC Building Network-Aware Mobile PC Applications Build a network-aware application using the Windows Network Location Awareness (NLA) API. Building Power-Aware Mobile PC Applications Learn how to tune your applications to save power, extend battery life, and enhance the user's mobile PC experience. Building Managed Applications with Microsoft Windows XP Tablet PC SDK Create a cool Tablet application using the Windows XP Tablet PC Edition SDK 1.7.

45 The Tablet and Mobile PC Developer Center http://msdn.microsoft.com/mobilepc

46 Mobile PC Developer Center The latest technical articles Downloads Developer resources Regular columns.Newsgroups Featured partners and more……

47 Tablet PC Developer Center The latest technical articles Downloads Developer resources Regular columns.Newsgroups Featured partners and more……

48 Attend a free chat or web cast http://www.microsoft.com/communities/chats/default.mspx http://www.microsoft.com/usa/webcasts/default.asp List of newsgroups http://communities2.microsoft.com/communities/newsgroups/en-us/default.aspx MS Community Sites http://www.microsoft.com/communities/default.mspx Locate Local User Groups and Community Sites http://www.microsoft.com/communities/usergroups/default.mspx http://www.microsoft.com/communities/related/default.mspx


Download ppt "Anywhere Access to Data Markus Egger President, EPS Software Corp. Publisher, CoDe Magazine."

Similar presentations


Ads by Google