471,348 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 software developers and data experts.

Communicate between Applications

Hello NG

I have two applications.

App1: Database application. Inserts/updates data to database.
App2: Notifier:
The notifier checks if a record has been created or modified, by loading the
table rows that has notify status 1 or 2. Thats easy. When the notifier
finds a record with 1 it brings up a window like in Outlook when new mail.

Now:
On the notifier form i want to have the ability to click on a button that
brings up App1 with the new data displayed.
And my question is: What to use to communicate between these two
applications in C#

Kind regards

Johnny E. Jensen
Aug 12 '08 #1
9 4866
On Aug 12, 11:08*pm, "Johnny E. Jensen" <j...@winner-crm.dkwrote:
Hello NG

I have two applications.

App1: Database application. Inserts/updates data to database.
App2: Notifier:
The notifier checks if a record has been created or modified, by loading the
table rows that has notify status 1 or 2. Thats easy. When the notifier
finds a record with 1 it brings up a window like in Outlook when new mail..

Now:
On the notifier form i want to have the ability to click on a button that
brings up App1 with the new data displayed.
And my question is: What to use to communicate between these two
applications in C#
You can use plain named pipes (see System.IO.Pipes), and serialize/
deserialize data manually. Or you can use .NET remoting (which can
also be set up to work over named pipes between two local processes).
Aug 12 '08 #2
>I have two applications.
>>
App1: Database application. Inserts/updates data to database.
App2: Notifier:
The notifier checks if a record has been created or modified, by
loading the
table rows that has notify status 1 or 2. Thats easy. When the
notifier
finds a record with 1 it brings up a window like in Outlook when new
mail.
Now:
On the notifier form i want to have the ability to click on a button
that
brings up App1 with the new data displayed.
And my question is: What to use to communicate between these two
applications in C#
You can use plain named pipes (see System.IO.Pipes), and serialize/
deserialize data manually. Or you can use .NET remoting (which can
also be set up to work over named pipes between two local processes).
Why not to expose public properties and events in app1? Simple "observer"
desing pattern.
Aug 13 '08 #3
On Aug 13, 10:02*am, Andrei Varanovich [C# MVP] <dotne...@gmail.com>
wrote:
I have two applications.
App1: Database application. Inserts/updates data to database.
App2: Notifier:
The notifier checks if a record has been created or modified, by
loading the
table rows that has notify status 1 or 2. Thats easy. When the
notifier
finds a record with 1 it brings up a window like in Outlook when new
mail.
Now:
On the notifier form i want to have the ability to click on a button
that
brings up App1 with the new data displayed.
And my question is: What to use to communicate between these two
applications in C#
You can use plain named pipes (see System.IO.Pipes), and serialize/
deserialize data manually. Or you can use .NET remoting (which can
also be set up to work over named pipes between two local processes).

Why not to expose public properties and events in app1? Simple "observer"
desing pattern.
He's talking about two different applications - that is, two different
processes - not a class library and an executable. You can't
subscribe to an event in a different process.

http://en.wikipedia.org/wiki/Inter-p..._communication
Aug 13 '08 #4
He's talking about two different applications - that is, two different
processes - not a class library and an executable. You can't
subscribe to an event in a different process.
So you can't subscribe to MS Word or Excel event from your app?
Aug 13 '08 #5
On Aug 13, 11:18*am, Pavel Minaev <int...@gmail.comwrote:
On Aug 13, 10:02*am, Andrei Varanovich [C# MVP] <dotne...@gmail.com>
wrote:


>I have two applications.
>App1: Database application. Inserts/updates data to database.
>App2: Notifier:
>The notifier checks if a record has been created or modified, by
>loading the
>table rows that has notify status 1 or 2. Thats easy. When the
>notifier
>finds a record with 1 it brings up a window like in Outlook when new
>mail.
>Now:
>On the notifier form i want to have the ability to click on a button
>that
>brings up App1 with the new data displayed.
>And my question is: What to use to communicate between these two
>applications in C#
You can use plain named pipes (see System.IO.Pipes), and serialize/
deserialize data manually. Or you can use .NET remoting (which can
also be set up to work over named pipes between two local processes).
Why not to expose public properties and events in app1? Simple "observer"
desing pattern.

He's talking about two different applications - that is, two different
processes *- not a class library and an executable. You can't
subscribe to an event in a different process.

http://en.wikipedia.org/wiki/Inter-p...communication- Hide quoted text -

- Show quoted text -
I guess publish-subscribe pattern work fine here. There are standard
ways of implementing the observer pattern between the applications.
One of such implementation can use remoting.
Aug 13 '08 #6
On Aug 13, 12:08*am, "Johnny E. Jensen" <j...@winner-crm.dkwrote:
Hello NG

I have two applications.

App1: Database application. Inserts/updates data to database.
App2: Notifier:
The notifier checks if a record has been created or modified, by loading the
table rows that has notify status 1 or 2. Thats easy. When the notifier
finds a record with 1 it brings up a window like in Outlook when new mail..

Now:
On the notifier form i want to have the ability to click on a button that
brings up App1 with the new data displayed.
And my question is: What to use to communicate between these two
applications in C#

Kind regards

Johnny E. Jensen
As I see this case can be solved using "observer" / publish-subscribe
pattern between the application. Check out the standard ways of
implementing the pattern. As a middle tire you can use number of
technologies like ".Net Remoting" or introduce a channel like MSMQ or
a media bus or can be achieved through windows service also. Let us
know more details of the requirement.

-Cnu.
Aug 13 '08 #7
On Aug 13, 11:30*am, Andrei Varanovich [C# MVP] <dotne...@gmail.com>
wrote:
He's talking about two different applications - that is, two different
processes *- not a class library and an executable. You can't
subscribe to an event in a different process.

So you can't subscribe to MS Word or Excel event from your app?
You can, but it uses COM under the hood to do the remote invocation,
which does all the necessary marshalling (and probably ends up using
pipes, anyway). An apt .NET analog would be .NET remoting, as others
(including me) have already mentioned - but it still takes some effort
to implement, and it isn't quite seamless (even if close).

The main trick when using remoting when the client subscribes to event
and then sits there passively is to ensure proper lifetime management
of server objects.

Yes, for a server scenario, MSMQ is also a good option. But for a
relatively lightwent client app, Remoting over pipes is probably still
the easiest and the fastest.
Aug 13 '08 #8
>>He's talking about two different applications - that is, two
different processes - not a class library and an executable. You
can't subscribe to an event in a different process.
So you can't subscribe to MS Word or Excel event from your app?
You can, but it uses COM under the hood to do the remote invocation,
which does all the necessary marshalling (and probably ends up using
pipes, anyway). An apt .NET analog would be .NET remoting, as others
(including me) have already mentioned - but it still takes some effort
to implement, and it isn't quite seamless (even if close).

The main trick when using remoting when the client subscribes to event
and then sits there passively is to ensure proper lifetime management
of server objects.

Yes, for a server scenario, MSMQ is also a good option. But for a
relatively lightwent client app, Remoting over pipes is probably still
the easiest and the fastest.

OK, let's stick on the remoting over pipes :-) In fact I was talking about
the pattern and you was talking about the transport to implement this pattern.
Aug 13 '08 #9
>>As I see this case can be solved using "observer" / publish-subscribe
pattern between the application. Check out the standard ways of
implementing the pattern. As a middle tire you can use number of
technologies like ".Net Remoting" or introduce a channel like MSMQ or
a media bus or can be achieved through windows service also. Let us
know more details of the requirement.

-Cnu.

As I am following this thread.
Any sample coding to do the .NET remoting for this scenario?
Aug 15 '08 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by MrQuan | last post: by
3 posts views Thread by SQACSharp | last post: by
8 posts views Thread by michelqa | last post: by
1 post views Thread by Ronak mishra | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.