Extending the Enterprise using .NET CF and SQL CE
Download
Report
Transcript Extending the Enterprise using .NET CF and SQL CE
Extending the Enterprise
using .NET CF and SQL CE
Marcus Perryman
Principal Consultant
Microsoft
Agenda
Traditional
client server applications
What is wrong with the client right now?
Connected
Mobile devices
Reality of communications
What does it mean to the developer
Mitigating the connection
Design issues
Technologies to help: SQLCE, MSMQ
Modifying
Football Reporter
Adding replication
Local DB access
Summary
Traditional Client Server
Applications
Client Server: What’s wrong with that?
E.G. (Enterprise) Football Reporter application
Reporter goes to match and discovers there is no
connection coverage. The app is useless while at the
match!
What do we need to do to make it work?
Situation Today
High dependency on the network
No local data – all data taken ‘live’ from a web service
Goals
Need some way to ‘work offline’
Still need to keep the ‘live’ feel of the application
Smart Device Applications
Stand alone Feature apps
Stand alone LOB apps
Limited data capture / processing
E.g. Calculator, Stopwatch, Games
Some data storage + manipulation
Quote system, Mapping, help or training
Fully Connected Apps / Client Server
Required connection, remote data store with
cache locally
Instant Messenger, Complex Quote system,
Terminal Server, Games, Football Reporter
Connection Technologies
WLAN
GPRS
Pro’s: Fast, cheap and fairly reliable
Con’s: Availability, radio black spots
Pro’s: Coverage, speed
Con’s: Cost, reliability, latency
Multi part solutions (e.g. serial/USB to host)
Pro’s: Fast, cheap and very reliable
Con’s: Complexity, mobile equipment, still need
to get online!
Connection Technologies
Circuit Switched Data
(e.g. GSM, CDMA)
WAP
SMS
Cable
Replacement
Bluetooth
Packet Data (e.g.
GPRS, 1xRTT)
TCP/IP
802.11
Desktop Pass-Through
Application style
Native apps
Local Store
Native apps
Cache &
Proxy
Big device
Web pages
Big bandwidth
• Store and forward
• Data synchronisation
• Network detection
What does this mean to the
Developer?
Your App
PRESENTATION LAYER
BUSINESS LOGIC LAYER
Business
Process 1
Business
Process 2
DATA ACCESS LAYER
Data
Store
‘Store and Forward’ Design
Your App
Response
Request
Service Request Proxy
Local
Data
Device
Servers
1. Find
3. Process
updates
2. Call
Stub
Service
Discovery
Stub
Service 1
Stub
Service 2
Stub
Notification
Service
Design Considerations
Reduce application dependency on
network
Minimise data transfer volumes
Batch up actions to reduce call times
Just do the ‘right’ thing.
Assumptions
Low bandwidth, unreliable channel
All application calls made are atomic
Servers know about client applications
Client applications know about servers
‘Know where to look rather than remember
everything’
Solution Landscape
Client
Server
Notification
Service
Custom
network
logic
Web
Services
PIM
Sync
SQL for CE
RDA
IIS
SOAP
Proxy
MSMQ
MSMQ
Listener
Base client
Exchange 2000
SQL 2000
SQL Server CE Overview
Key Scenarios
Disconnected database
Internet / Intranet connectivity /
synchronization
Different from Mobile Web Forms / MMIT,
ADO.NET Data Set and MSMQ CE
Managed and Unmanaged Support
Customer Scenarios
Medical, Military, DSD, FSA, SFA, Real estate
Database Feature Set
Rich functionality for small footprint
Multi-column indexes
Referential integrity
Sub-selects (IN)
Defaults
Inner/outer joins
One file database
Null support
Unicode support
Transactions
Data-types
Real, Numeric, NVarChar,
NText, Image, Integer,
DateTime, VarBinary,
UniqueIdentifier, Money
Having/group by
Seek on index
Set functions
Identity attribute
Local security - DB
encryption (128bit) and
database password
SQL Server CE v2.0 Device Data Access
SDE / Managed Stack
Native/Unmanaged Stack
VS .NET (VB.NET, C#)
eVB 3.0
ADO
CE v3.1
ADO.NET
eVC
3.0
SQL Server CE 2.0 Data
Provider
CLR / .NET CF
OLEDB CE
SQL Server CE v2.0
OLEDB
QP/Cursor Engine/ES
OLEDB
Storage Engine / Repl Tracking
SQL Server CE V2.0 .NET CF
Integration
System.Data.SqlServerCE
Local Data Provider
Rich data access while offline
Exposes full functionality of SQL Server CE
Utilizes Try/Catch
System.Data.SqlServerCe.SqlCeException
CE Data Access
Storage Architecture
Enterprise Backend
Oracle / db2 / etc
.NET CF / Managed Stack
Native/Unmanaged Stack
eVB
3.0
ADO
CE
v3.1
ADO.NET
eVC
3.0
XML/BizTalk/CS 2002
VS .NET (VB.NET, C#)
SQL Server
CE Data
Provider
SQL Server
Client Data
Provider
CLR / .NET CF
Ethernet
TDS
Well
Connected
OLEDB CE
SQL CE Edition v2.0
Data Provider
OLEDB
QP/Cursor Engine/ES
OLEDB
Client
Agent:
Replication
and
RDA
Storage Engine / Repl
Tracking
802.11b,
CDPD,
GSM,
CDMA,
TDMA, etc.
IIS
HTTP
Occasionally
Connected
CLIENT
SERVER
OLEDB /
Replication API
Server
Agent:
Replication
and
Remote
Data
Access
Connectivity – Transport
Utilize Web technology
HTTP communication
Internet and Intranet
Security via IIS
Authentication (anonymous, basic,
NTLM)
Authorization
Encryption for secure transfer (SSL)
Access through firewalls
SQL Server CE v2.0 Platform
Support
Tool Set
Data Access
Platform
eMVT
ADOCE / OLEDBCE
HPC 2K
eMVT
ADOCE / OLEDBCE
PocketPC 2000
eMVT
ADOCE / OLEDBCE
PB 4.1 “Jameson”
VS.NET / .NET CF
ADO.NET
PocketPC 2002
VS.NET / .NET CF
ADO.NET
PocketPC 2000
VS.NET / .NET CF
ADO.NET
PB 4.1 “Jameson”
eMVT
ADOCE / OLEDBCE
PocketPC 2002
SQL Server CE Summary
Enables data capture in the field
Enables rapid development
Utilizes new Visual Studio .NET tools
Existing application with eMVT still run
Enable robust connectivity
Small size, robust functionality
HTTP, IIS, connect anywhere
RDA, Replication
Expand the enterprise
Upwardly compatible with
SQL Server 2000
Microsoft Message Queue
MSMQ – What
Implements asynchronous communications
Provides guaranteed delivery, efficient
routing, priority based messaging.
Usernames storage support roaming
NIC tracking
Transparent, salvageable storage
Routing to non-private queues is simple
Administration differences
Modifying Football Reporter
Creating a Publication on the server
Using the new SQLCE 2.0 server wizard
Modify Reporter App
Add the code to replicate
Add code to login to local DB
Modifying Football247 Reporter
Build network check code
Add Network Check code
Call and store data to the web service
Summary
Application design for a truly Mobile app
is key to success.
SQL Server CE is a key tools for
mitigating unreliable network
connections.
SQL Server CE Managed provider makes
data consumption simple.
© 2001 Microsoft Corporation. All rights reserved.