25
Extending the Enterprise Extending the Enterprise using .NET CF and SQL CE using .NET CF and SQL CE Marcus Perryman Marcus Perryman Principal Consultant Principal Consultant Microsoft Microsoft

Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

Embed Size (px)

Citation preview

Page 1: Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

Extending the Enterprise Extending the Enterprise using .NET CF and SQL CEusing .NET CF and SQL CE

Marcus PerrymanMarcus Perryman

Principal ConsultantPrincipal Consultant

MicrosoftMicrosoft

Page 2: Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

AgendaAgenda

Traditional client server applicationsTraditional client server applications What is wrong with the client right now?What is wrong with the client right now?

Connected Mobile devicesConnected Mobile devices Reality of communicationsReality of communications What does it mean to the developerWhat does it mean to the developer Mitigating the connectionMitigating the connection Design issuesDesign issues Technologies to help: SQLCE, MSMQTechnologies to help: SQLCE, MSMQ

Modifying Football ReporterModifying Football Reporter Adding replicationAdding replication Local DB accessLocal DB access

SummarySummary

Page 3: Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

Traditional Client Traditional Client Server ApplicationsServer Applications Client Server: What’s wrong with that?Client Server: What’s wrong with that? E.G. (Enterprise) Football Reporter E.G. (Enterprise) Football Reporter

applicationapplication Reporter goes to match and discovers there is no Reporter goes to match and discovers there is no

connection coverage. The app is useless while at the connection coverage. The app is useless while at the match! match!

What do we need to do to make it work?What do we need to do to make it work? Situation TodaySituation Today

High dependency on the networkHigh dependency on the network No local data – all data taken ‘live’ from a web No local data – all data taken ‘live’ from a web

serviceservice GoalsGoals

Need some way to ‘work offline’Need some way to ‘work offline’ Still need to keep the ‘live’ feel of the applicationStill need to keep the ‘live’ feel of the application

Page 4: Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

Smart Device Smart Device ApplicationsApplications Stand alone Feature appsStand alone Feature apps

Limited data capture / processingLimited data capture / processing E.g. Calculator, Stopwatch, Games E.g. Calculator, Stopwatch, Games

Stand alone LOB appsStand alone LOB apps Some data storage + manipulationSome data storage + manipulation Quote system, Mapping, help or trainingQuote system, Mapping, help or training

Fully Connected Apps / Client ServerFully Connected Apps / Client Server Required connection, remote data store Required connection, remote data store

with cache locallywith cache locally Instant Messenger, Complex Quote Instant Messenger, Complex Quote

system, Terminal Server, Games, system, Terminal Server, Games, Football ReporterFootball Reporter

Page 5: Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

Connection TechnologiesConnection Technologies

WLANWLAN Pro’s: Fast, cheap and fairly reliablePro’s: Fast, cheap and fairly reliable Con’s: Availability, radio black spotsCon’s: Availability, radio black spots

GPRSGPRS Pro’s: Coverage, speedPro’s: Coverage, speed Con’s: Cost, reliability, latencyCon’s: Cost, reliability, latency

Multi part solutions (e.g. serial/USB to Multi part solutions (e.g. serial/USB to host)host) Pro’s: Fast, cheap and very reliablePro’s: Fast, cheap and very reliable Con’s: Complexity, mobile equipment, still Con’s: Complexity, mobile equipment, still

need to get online!need to get online!

Page 6: Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

Connection TechnologiesConnection Technologies

Circuit Switched Data Circuit Switched Data (e.g. GSM, CDMA)(e.g. GSM, CDMA)

Packet Data (e.g. Packet Data (e.g. GPRS, 1xRTT)GPRS, 1xRTT)

SMSSMS

802.11802.11

Desktop Pass-ThroughDesktop Pass-Through

BluetoothBluetooth

TCP/IPTCP/IP

WAPWAP

Cable Cable ReplacementReplacement

Page 7: Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

Application styleApplication style

Native appsLocal Store

Native appsCache &

ProxyWeb pages

Big device Big bandwidth

• Store and forwardStore and forward• Data synchronisationData synchronisation• Network detectionNetwork detection

Page 8: Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

What does this mean to What does this mean to the Developer?the Developer?

Your AppYour App

Data Data StoreStore

Business Business Process 1 Process 1

Business Business Process 2Process 2

PRESENTATION LAYERPRESENTATION LAYER

BUSINESS LOGIC LAYERBUSINESS LOGIC LAYER

DATA ACCESS LAYERDATA ACCESS LAYER

Page 9: Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

‘‘Store and Forward’ Store and Forward’ DesignDesign

Your AppYour App

Local Local DataData

Service Request ProxyService Request Proxy

RequestRequestResponseResponse

Service Service DiscoveryDiscovery

Service 1 Service 1 Service 2Service 2 Notification Notification ServiceService

DeviceDevice

ServersServers1. Find1. Find

2. Call2. Call 3. Process 3. Process updatesupdates

StubStub StubStub StubStub StubStub

Page 10: Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

Design ConsiderationsDesign Considerations Reduce application dependency on Reduce application dependency on

networknetwork Minimise data transfer volumesMinimise data transfer volumes Batch up actions to reduce call timesBatch up actions to reduce call times Just do the ‘right’ thing.Just do the ‘right’ thing.

AssumptionsAssumptions Low bandwidth, unreliable channelLow bandwidth, unreliable channel All application calls made are atomicAll application calls made are atomic Servers know about client applicationsServers know about client applications Client applications know about serversClient applications know about servers ‘‘Know where to look rather than Know where to look rather than

remember everything’remember everything’

Page 11: Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

Solution LandscapeSolution Landscape

ClientClient

Base clientBase client

SQL for CESQL for CESyncSync

RDARDA

ServerServer

MSMQMSMQ

SO

AP

SO

AP

Proxy

Proxy

ListenerListener

Exchange 2000Exchange 2000

SQL 2000SQL 2000

PIMPIM

IISIIS

Web Web ServicesServices

MSMQMSMQ

Custom Custom network network

logiclogic

NotificationNotificationServiceService

Page 12: Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

SQL Server CE OverviewSQL Server CE Overview

Key ScenariosKey Scenarios Disconnected databaseDisconnected database Internet / Intranet connectivity / Internet / Intranet connectivity /

synchronizationsynchronization Different from Mobile Web Forms / MMIT, Different from Mobile Web Forms / MMIT,

ADO.NET Data Set and MSMQ CEADO.NET Data Set and MSMQ CE Managed and Unmanaged SupportManaged and Unmanaged Support

Customer ScenariosCustomer Scenarios Medical, Military, DSD, FSA, SFA, Real Medical, Military, DSD, FSA, SFA, Real

estateestate

Page 13: Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

Database Feature SetDatabase Feature SetRich functionality for small Rich functionality for small footprintfootprint Multi-column indexesMulti-column indexes Referential integrityReferential integrity Sub-selects (IN)Sub-selects (IN) DefaultsDefaults Inner/outer joinsInner/outer joins One file databaseOne file database Null supportNull support Unicode supportUnicode support TransactionsTransactions

Data-typesData-types Real, Numeric, Real, Numeric,

NVarChar, NText, NVarChar, NText, Image, Integer, Image, Integer, DateTime, VarBinary, DateTime, VarBinary, UniqueIdentifier, UniqueIdentifier, MoneyMoney

Having/group byHaving/group by Seek on indexSeek on index Set functionsSet functions Identity attributeIdentity attribute Local security - DB Local security - DB

encryption (128bit) encryption (128bit) and database and database passwordpassword

Page 14: Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

OLEDB CEOLEDB CECLR / .NET CFCLR / .NET CF

QP/Cursor Engine/ES QP/Cursor Engine/ES

SQL Server CE v2.0 Device Data AccessSQL Server CE v2.0 Device Data Access

ADOADOCE v3.1CE v3.1

Storage Engine / Repl TrackingStorage Engine / Repl Tracking

SQL Server CE v2.0SQL Server CE v2.0

eVB 3.0eVB 3.0eVC eVC 3.03.0

OLEDBOLEDB

OLEDBOLEDB

SQL Server CE 2.0 Data SQL Server CE 2.0 Data ProviderProvider

Native/UnmanagedNative/Unmanaged StackStack SDE / ManagedSDE / Managed StackStack

ADO.NETADO.NET

VS .NET (VB.NET, C#)VS .NET (VB.NET, C#)

Page 15: Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

SQL Server CE V2.0 .NET CF SQL Server CE V2.0 .NET CF IntegrationIntegration

System.Data.SqlServerCESystem.Data.SqlServerCE Local Data ProviderLocal Data Provider Rich data access while offlineRich data access while offline Exposes full functionality of SQL Server CEExposes full functionality of SQL Server CE

Utilizes Try/Catch Utilizes Try/Catch System.Data.SqlServerCe.SqlCeExceptionSystem.Data.SqlServerCe.SqlCeException

Page 16: Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

OLEDB CEOLEDB CE

CLR / .NET CFCLR / .NET CF

QP/Cursor Engine/ES QP/Cursor Engine/ES

CE Data AccessCE Data AccessStorage ArchitectureStorage Architecture

Client Client Agent: Agent:

ReplicationReplicationandandRDARDA

ADO ADO CE CE v3.1v3.1

OLEDB / OLEDB / Replication APIReplication API

IISIIS

CLIENTCLIENT SERVERSERVER

Storage Engine / Repl Storage Engine / Repl TrackingTracking

SQL CE Edition v2.0SQL CE Edition v2.0

eVB eVB 3.03.0 eVC eVC

3.03.0

OLEDBOLEDB

OLEDBOLEDB

Server Server Agent: Agent:

ReplicationReplicationandand

Remote Remote Data Data

AccessAccess

HTTPHTTP

XML/BizTalk/CS 2002XML/BizTalk/CS 2002

802.11b, 802.11b, CDPD, CDPD, GSM, GSM,

CDMA, CDMA, TDMA, etc.TDMA, etc.

Enterprise BackendEnterprise Backend

Oracle / db2 / etcOracle / db2 / etc

SQL Server SQL Server CE Data CE Data ProviderProvider

Native/UnmanagedNative/Unmanaged StackStack

Data ProviderData Provider

SQL Server SQL Server Client Data Client Data Provider Provider

ADO.NETADO.NET

VS .NET (VB.NET, C#)VS .NET (VB.NET, C#)..NET CF / ManagedNET CF / Managed StackStack

TDSTDS

EthernetEthernet

Well Well ConnectedConnected

Occasionally Occasionally ConnectedConnected

Page 17: Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

Connectivity – TransportConnectivity – Transport

Utilize Web technologyUtilize Web technology HTTP communicationHTTP communication

Internet and IntranetInternet and Intranet Security via IISSecurity via IIS

Authentication (anonymous, Authentication (anonymous, basic, NTLM)basic, NTLM)

AuthorizationAuthorization Encryption for secure transfer Encryption for secure transfer

(SSL)(SSL) Access through firewallsAccess through firewalls

Page 18: Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

SQL Server CE v2.0 SQL Server CE v2.0 Platform SupportPlatform SupportTool SetTool Set Data AccessData Access PlatformPlatform

eMVTeMVT ADOCE / OLEDBCEADOCE / OLEDBCE HPC 2KHPC 2K

eMVTeMVT ADOCE / OLEDBCEADOCE / OLEDBCE PocketPC 2000PocketPC 2000

eMVTeMVT ADOCE / OLEDBCEADOCE / OLEDBCE PB 4.1 “Jameson”PB 4.1 “Jameson”

VS.NET / .NET CFVS.NET / .NET CF ADO.NETADO.NET PocketPC 2002PocketPC 2002

VS.NET / .NET CFVS.NET / .NET CF ADO.NETADO.NET PocketPC 2000PocketPC 2000

VS.NET / .NET CFVS.NET / .NET CF ADO.NETADO.NET PB 4.1 “Jameson”PB 4.1 “Jameson”

eMVTeMVT ADOCE / OLEDBCEADOCE / OLEDBCE PocketPC 2002PocketPC 2002

Page 19: Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

SQL Server CE SummarySQL Server CE Summary

Enables data capture in the fieldEnables data capture in the field Small size, robust functionality Small size, robust functionality

Enables rapid developmentEnables rapid development Utilizes new Visual Studio .NET tools Utilizes new Visual Studio .NET tools Existing application with eMVT still runExisting application with eMVT still run

Enable robust connectivityEnable robust connectivity HTTP, IIS, connect anywhereHTTP, IIS, connect anywhere RDA, ReplicationRDA, Replication

Expand the enterpriseExpand the enterprise Upwardly compatible with Upwardly compatible with

SQL Server 2000SQL Server 2000

Page 20: Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

Microsoft Message Microsoft Message QueueQueue

Page 21: Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

MSMQ – WhatMSMQ – What

Implements asynchronous Implements asynchronous communicationscommunications

Provides guaranteed delivery, Provides guaranteed delivery, efficient routing, priority based efficient routing, priority based messaging.messaging.

Usernames storage support roamingUsernames storage support roaming NIC trackingNIC tracking Transparent, salvageable storageTransparent, salvageable storage Routing to non-private queues is Routing to non-private queues is

simplesimple Administration differencesAdministration differences

Page 22: Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

Modifying Football ReporterModifying Football Reporter

Creating a Publication on the serverCreating a Publication on the server Using the new SQLCE 2.0 server Using the new SQLCE 2.0 server

wizardwizard Modify Reporter App Modify Reporter App

Add the code to replicate Add the code to replicate Add code to login to local DBAdd code to login to local DB

Page 23: Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

Build network check codeBuild network check code Add Network Check codeAdd Network Check code Call and store data to the web Call and store data to the web

serviceservice

Modifying Football247 Modifying Football247 ReporterReporter

Page 24: Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

SummarySummary

Application design for a truly Mobile Application design for a truly Mobile app is key to success.app is key to success.

SQL Server CE is a key tools for SQL Server CE is a key tools for mitigating unreliable network mitigating unreliable network connections.connections.

SQL Server CE Managed provider SQL Server CE Managed provider makes data consumption simple.makes data consumption simple.

Page 25: Extending the Enterprise using.NET CF and SQL CE Marcus Perryman Principal Consultant Microsoft

© 2001 Microsoft Corporation. All rights reserved.© 2001 Microsoft Corporation. All rights reserved.