Welcome to MSDN Blogs Sign in | Join | Help

David Hill's WebLog

Iblogyoublogweblog
Offline Application Block

The Smart Client Offline Application Block is now live on MSDN.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/offline.asp

This block has re-usable code and samples which show how you can build smart client applications which can operate offline. With this block your application can detect the presence or absence of a network connection, cache data for use while offline, and re-synchronize data and tasks with the network once the application goes online.

The block uses a store and forward mechanism which is suitable for message-based interactions with the network, such as you would get with a smart client operating in a service oriented environment. This is a very flexible model and doesn’t require the kind of tight integration between client and server you find with database merge-replication approaches to offline…

Posted: Monday, March 01, 2004 11:29 PM by dphill
Filed under:

Comments

Greg Robinson said:

Hows does the block detect the presence or absence of a network connection?
# March 2, 2004 4:39 AM

ScottWater said:

The Smart Client Offline Application Block is now live on MSDN.
# March 2, 2004 7:53 AM

{ public virtual blog; } said:

Last month Microsoft released a new application block. This application block of re-usable code and samples, can be used to model your own applications to allow them to detect the presence or absence of a network connection, cache data for use while offline, and re-synchronize data and tasks with the network once the application goes online.
# March 2, 2004 11:43 AM

Paul Tyng said:

Greg,

I downloaded the block last night and was reading through the documentation, I beleive it said that the developer will need to implement that specific piece (online / offline detection). It looks to me to be a much more involved wrapper to the caching application block that queue's up actions for re-connection, etc. I may be wrong but that was my inital take on it.

Paul Tyng
# March 2, 2004 10:44 AM

Paul Tyng said:

I'm not entirely correct, what I was reading about was the custom detection, the block comes with a default implementation of connection detection:

"The default connection detection provider uses the InternetGetConnectedState method of the WinInet dynamic-link library (DLL) to detect connection state changes. For example, if you remove the network cable from a computer that is connected to the network while running the sample, the connection state displays the change to offline mode."

[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/offline-ch03.asp]
# March 2, 2004 10:49 AM

David Hill said:

Yes - the block includes a default implementation which tells you whether there is a network connection or not. This may suffice for simple cases but, in general, you may want to implement something more suitable for your application.

Having a network connection is a necessary but not sufficient condition to being online. Even with a network connection you can't be sure that the service you are trying to get to is available - if the service is not available, you are essentially offline despite being connected to the network.

Using the pluggable architecture of the block, you can implement a more meaningful offline state detection mechanism. For instance, you could periodically ping the required service, though arguably this is pretty inefficient and inelegant.
# March 2, 2004 10:57 AM

Mark Olson's blog said:

# March 4, 2004 1:45 AM

fschwiet said:

Hey I was just cruising the blogs and am not really up to speed on the smart client stuff.

<TABLE ALIGN="CENTER" BORDER="1">
<TR>
<TD>Using the pluggable architecture of the block, you can implement a more meaningful offline state detection mechanism. For instance, you could periodically ping the required service, though arguably this is pretty inefficient and inelegant.
</TD>
</TR>
</TABLE>

A general approach that can work here though is to ping whenever a network connectoid becomes connected or disconnected. Ping the desired resource source, maybe authenticate the desired resource source if you care about a spoofed connected state. Its hard to have a generic connected/disconnected detector because the network of interest varies.
# April 3, 2004 6:34 PM
Anonymous comments are disabled
Page view tracker