The following post summarizes the main features of the DSA Application Block provided by the Smart Client Software Factory to work under temporary disconnected scenarios.

The DSA Application Block provides feature to simplify the management of requests on occasionally connected smart client applications.

There are two main features of the DSA Application Block that serve this purpose:

Request Manager

The request  manager is a subsystem of classes which work together to manage the dispatching of Web Service Requests.

The request queue data persists in different ways(MemoryRequestQueue/DataBaseRequestQueue). When the Connection Monitor Application Block notifies the Request Manager class that the connection is online, it retrieves the Requests from the RequestQueues and send them using the RequestDispatcher.

Each request has the following information:

  • OfflineBehavior
  • Name of the endpoint where the service is, to retrieve from the Endpoint Catalog Application Block.
  • RequestID
  • WebService arguments (parameters [])

Request Dispatcher

The Request Dispatcher sends the requests when connectivity is online (Connection Monitor Application Block) and the Endpoint address is good (Endpoint Application Block). A ConnectionMonitorAdapter (”inspired” by the Connection Monitor Application Block) class allows the easy checking of the Connection attributes.

The following diagram (obtained from the SCSF documentation) shows the relationship between the main classes of the DSA.

dsa

For more information about the DSA you can check:

5 Responses to “DSA Application Block Overview”

  1. Mariano Converti » Composite WPF with DSA sample Says:

    [...] the May 2007 version was specially designed for this type of scenarios. Damian Schenkelman wrote a blog post overviewing the DSA to answer some of these [...]

  2. Arabinda Says:

    Damian,

    Thanks for the Nice Article. I need a clarification. Does it stores the data in local system when it is offline ? My requirement is the system should work as usual when it is not connected to network. Once the system is connected to network automatically data sync up should happen. So can you please guid me on that . Can i use this application for that ?

    Thanks,
    Arabinda

  3. dschenkelman Says:

    Hi Arabinda,

    If you are referring to the data held in the Request Queue, the DSA allows you to hold your request data in your local machine.
    You can hold your data in Memory using MemoryRequestQueue provided by the DSA Application Block or in a local DataBase using a DataBaseRequestQueue that can be found in the Enterprise Library project of the DSA QuickStart . You can also create a custom implementation of the RequestQueue by implementing the IRequestQueue interface in a class.
    You should choose the approach (MemoryRequestQueue/DataBaseRequestQueue) you find more useful for your scenario.
    You might find some more information about the DataBaseRequestQueue in this Codeplex thread (http://www.codeplex.com/smartclient/Thread/View.aspx?ThreadId=33926).
    As for sending request when the network is available you can create a handler for the StateChanged event of the connection you want to monitor. Then check the IsConnected property and dispatch all pending requests.

    For more information you can check:
    Handling Connectivity Change Events (http://msdn.microsoft.com/en-us/library/cc540749.aspx)
    Dispatching All Pending Requests (http://msdn.microsoft.com/en-us/library/cc540763.aspx)

    Let me know if this was what you were looking for,
    Damian

  4. RosaL Says:

    Hello Damian,
    Good article. I am looking for help with the following question. When I use the DSA/WCF web services, it would appear each of my web services calls are being serialized. The test I do is the following:
    1) Setup 2 web services. Two different end points.
    2) Web Service A, takes a long time to execute. Web Service B, takes a short time.
    3) I use the DSA to enqueue my calls to services A and B. I am manually dispatching both requests, and I make sure my request queue is empty.
    4) I use Fiddler and debugging on the callbacks and I see the call B does not return only after call A returns.
    5) For example if call A takes 5 secons to process and call B takes 1 sec to process. I would expect that if I dispatch A and B at the same time. I would expect to get my callback from B in 1 sec, and then 4 secons later the call back from A.

    Can you help clarify how DSA handles concurrency?
    Thank you

  5. Damian Schenkelman’s Blog » Blog Archive » Developing applications with WPF and Windows 7 (Part I) Says:

    [...] of different Snow Boards. It also provides support for temporarily connected scenarios using the Disconnected Service Agent Application Block from the Smart Client Software Factory. The demo shows the following interaction with Windows [...]

Leave a Reply