Best practices for sharing data and notifications between applications

What is the best practice for sharing data between different applications on the same computer and notifying them if the data has been changed?

I have 4 applications that use the same settings project to change their settings. When I change a setting in a project, other applications must work on this change and must know that the setting has been changed.

I thought that IPC should make changes to the settings and then pass the change information to all users, but it would be great if such a library already existed.

EDIT:

I found a solution that worked for me. We decided not to spend a lot of time on this functionality, because it is not critical for updating other applications.

We save our settings, as before, in an XML file, and I registered FileSystemWatcher in this file to get all the changes. Therefore, if I change the settings, all 4 applications will go over and read the settings file and determine whether they should take action or not.

+8
c # notifications share
source share
4 answers

The decision that you need to choose depends on various parameters:

  • How much effort you can invest in implementation.
  • How important it is for applications to update quickly.
  • What environment is available to you / your customers.
  • ...

For example:

  • saving changes to the database / configuration file, as well as launching applications in a separate stream, which is designed to check changes in settings every n seconds. It’s cheap and easy to implement this solution, but not β€œnice,” and many developers will reject such a solution.
  • Create a WCF service that "publishes" application changes. In this case, using double bindings, applications will be updated instantly. Of course, this solution is more expensive ....

These are just 2 examples of the many available solutions (shared memory, common application domain, etc.).

+1
source share

What you did seems reasonable. And I have other experience using MSMQ . You can create private or public queues, since you have all the applications on one computer, the private queue is in order, otherwise you should use public queues. During this time, I chose Spring.Net as my framework (object builder and dependency injector). Spring.net has brilliant QuickStarts , and one of them uses MSMQ as a communication bridge between applications. If I were you, I would use the Queuing approach, because you can notify applications running on different computers.

In addition, WCF provides convenient tools for developing a distributed service across the core component of MSMQ.

In addition, publication-subscription is a common design pattern that is widely used in client / server communication applications. The Publish-Subscribe template will also help in developing a WCF template in those scenarios in which the service application will provide data to certain groups of customers who are interested in the service, and the data is provided to clients as a push model actively (instead of being polled by the client)

+1
source share

How to use inline dependency objects? as:

they are pretty easy to implement and they work well

0
source share

What about network sockets? You can create listeners and senders on different ports

0
source share

All Articles