xml as a data hub between 2 application.

  • Thread starter Thread starter Peter Rilling
  • Start date Start date
P

Peter Rilling

There are some issues with what you want to do.

1) Xml is loaded entirely into memory when the DOM is created and then the
connection (generally) is lost from the physical file.
2) Two applications live in different processes and therefore cannot share
a references to the same object. On application cannot subscribe to events
for an object created in a different application.

I am not familiar with remoting, but you might need to use that to
facilitate the communication. Or you might try implementing a COM+ object
that runs as an application, then more then one application might be able to
get a reference to that object which would then wrap operations on the XML
file.


"Chau Johnthan"
 
Are you looking to use msxml or the XmlDocument class?

From the documentation for XmlDocument, it looks like there are events that
are fired when the DOM changes. You could subscribe to these, but what you
will need to make sure that you subscribe to the events on the same object
that you are modifying.

"Chau Johnthan"
 
I have two applications, and they use the same xml doc as a data
exchange channel.

Why on earth choose an XML data doc as the common ground? If you have
multiple apps working on the same data, a RDBMS seems like a better
choice to me.....

XML is great as a cross-boundry data exchange format - it's *NOT*
replacement for a REAL database.

Just my $0.02

Marc
================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 
I have two applications, and they use the same xml doc as a data
exchange channel.

I mean each application holds a reference of this xml doc. each
can change the xml doc, in the mean time the other can get
node-changed events.

how should I implement this senario?




THANKS!
 
Hi, Peter:

Really appeciate your reply.

in fact, fortunately, my case shoule be one application, aside a
comopnent dll. I want to know if the msxml support attributes
changing-event, or is it possible to subscribe those eventset in xml
doc object.



Thanks!
 
I attempted unsuccessfully to use xml as an interprocess communication tool.
What with the problems of file locking and file corruption, it was a
headache. When I rewrote the xml accessing functions to use a DB, all these
problems dissapeared, as pretty much any DB you use will have these issues
sorted internally.

Mine was one of those projects that grows *way* beyond the initial scope.
For a couple of processes talking to each other every few minutes, XML
was... passible. For a few multi-threaded apps on different machines
talking amongst themselves, XML was overwhelmed. But when I moved to using
a DB, it was (surprisingly) faster, and *much* more stable. As a persistant
medium, DB's are the way forward.


"Chau Johnthan"
 
1) Use the registry, I think that is thread/process safe or can be.
2) Create Memory Mapped File (MMF) to store this struct for access across
processes and sync access to it with a named mutex.
3) Use remoting and host the data on one in memory. Public Remoting Get/Put
method on it for the "client" app.
 
Hi, Marc:
Why on earth choose an XML data doc as the common ground? If you have
multiple apps working on the same data, a RDBMS seems like a better
choice to me.....

XML is great as a cross-boundry data exchange format - it's *NOT*
replacement for a REAL database.

Just my $0.02

seems I should use sqlserver to store those application settings variables.
 
I attempted unsuccessfully to use xml as an interprocess communication
tool.
What with the problems of file locking and file corruption, it was a
headache. When I rewrote the xml accessing functions to use a DB, all these
problems dissapeared, as pretty much any DB you use will have these issues
sorted internally.

Mine was one of those projects that grows *way* beyond the initial scope.
For a couple of processes talking to each other every few minutes, XML
was... passible. For a few multi-threaded apps on different machines
talking amongst themselves, XML was overwhelmed. But when I moved to using
a DB, it was (surprisingly) faster, and *much* more stable. As a persistant
medium, DB's are the way forward.

I have just 7 (maybe 8) global variables to store, which db will be your
suggestion?
 
Back
Top