locked
sharing data between two different applications RRS feed

  • Question

  • User-899197698 posted

    Hi

    I have to different .Net applications running simultaneously. Assume both are windows / web applications.When I update some data in application A

    correspondingly data in application B must be updated. Can anyone pls let me know how is this possible?


    guyind

    Wednesday, February 17, 2010 5:49 AM

Answers

  • User-952121411 posted

    Yeah the line below from my 1st post should have been elaborated on a bit:

    "They could call the database or an intermediate service (WCF, .asmx, etc) to request the most current data." 

    The AJAX pieces are just to allow the individual apps query the database for updated data on interval and update somewhat seamlessly.  The important piece of this is that the data must be stored in an intermediary like a database.  The design I recommended does not have the (2) apps communicating directly, but each one independently calls the database (either directly or through a service that sits between the applications and the database) to get the most current data.  There is never a connection directly between the (2) applications.  They just both call a centralized point to get the most current data, and then you could use AJAX to refresh the UI for the client.

    If you wanted to do something more brut to just have the 2 applications communicate directly you could look at using a HTML "POST" and "GET" method to communicate directly between the (2) applications.  However if you add additional applications I think this solution becomes less scalable than the one where all of the clients go to a central point to retrieve the data.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, February 18, 2010 10:35 AM

All replies

  • User-952121411 posted

    There are several different approaches you could take with this.  One way to accomplish this is to have your sites poll for the data on an interval.  They could call the database or an intermediate service (WCF, .asmx, etc) to request the most current data.  Then based on your polling interval your sites would only be out of sync for a minimal amount of time.  If you make the polling interval small enough, you may notice very little difference in the data between the (2) sites.  If you used AJAX for example, you could use its Timer and UpdatePanel surrounding the data to be updated.  Then the app could do a partial postback, check for new data, and present it almost flawlessly to the user.  If you want to look into these (2) components, check out the following links:

    [How Do I:] Implement Dynamic Partial-Page Updates with ASP.NET AJAX? (This video has an example using a timer to do an example quite similar to your question):

    http://www.asp.net/learn/ajax-videos/video-78.aspx

    [How Do I:] Use the ASP.NET AJAX Timer Control?

    http://www.asp.net/learn/ajax-videos/video-99.aspx

    Another option would be if you ventured into the world of Silverlight.  Silverlight offers some ability that can make this process even more seamless.  It involves creating a WCF push service, that pushes data to the client.  WCF includes a polling duplex binding made specifically for Silverlight which allows a service to push data down to a client as the data changes.  If you are interested in looking at this, take a look to the following link:

    Pushing Data to a Silverlight Client with a WCF Duplex Service:

    http://weblogs.asp.net/dwahlin/archive/2008/06/16/pushing-data-to-a-silverlight-client-with-wcf-duplex-service-part-i.aspx

    Lastly, you could post the data of the one site directly to another URL, but I think this is the least scalable solution since the data to be syncd may not be persisted to an intermediary 1st (like a database), but it is certainly an option.  Here is one example of doing this:

    Posting form data from ASP.NET page to another URL:

    http://www.c-sharpcorner.com/UploadFile/desaijm/ASP.NetPostURL11282005005516AM/ASP.NetPostURL.aspx

    Hope this helps! Smile

    Wednesday, February 17, 2010 9:11 AM
  • User-899197698 posted

    Hi

    The video tutorials show an update on the same application. But I am confused as to how u can connect the two different applications and then perform the update. How does AJAX help in connecting two different applications. Could u pls be more explicit in ur reply?

    thanks

    guyind

    Thursday, February 18, 2010 3:08 AM
  • User-952121411 posted

    Yeah the line below from my 1st post should have been elaborated on a bit:

    "They could call the database or an intermediate service (WCF, .asmx, etc) to request the most current data." 

    The AJAX pieces are just to allow the individual apps query the database for updated data on interval and update somewhat seamlessly.  The important piece of this is that the data must be stored in an intermediary like a database.  The design I recommended does not have the (2) apps communicating directly, but each one independently calls the database (either directly or through a service that sits between the applications and the database) to get the most current data.  There is never a connection directly between the (2) applications.  They just both call a centralized point to get the most current data, and then you could use AJAX to refresh the UI for the client.

    If you wanted to do something more brut to just have the 2 applications communicate directly you could look at using a HTML "POST" and "GET" method to communicate directly between the (2) applications.  However if you add additional applications I think this solution becomes less scalable than the one where all of the clients go to a central point to retrieve the data.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, February 18, 2010 10:35 AM