Take the 2-minute tour ×

I have an application that will access interface service A which is to run from windows startup. This service is used by program B and my application functions on B's presence after getting a pointer to A. The scenario is translated as follows,

public interface A{}
///my program
public class MyProgram
    public MyProgram()
    public A GetA(){}

public class ProgramB
   void DoA(){}

The translated source is not true, but that seems to be what I am looking for. In order to eliminate the overhead of allocating and realocating dynamic accesses to the same service used by other processes, would you please provide an actual solution to the problem ?(I am all out of any idea now)

share|improve this question
So ProgramB is another process and A is yet another process? How are they communicating with each other? Also, I really don't understand what exactly are you asking. What overhead are you talking about? Are you sure that overhead is actually a problem for you? –  svick Dec 28 '11 at 13:50
for stuff like that, I'd consider singleton or better yet, queue –  gnat Dec 28 '11 at 15:00
@gnat would you care to elaborate in an answer instead of a comment how a singleton or a queue would help the OP? Like svick, I'm don't quite understand yet what the question is. –  PersonalNexus Dec 28 '11 at 15:30
@PersonalNexus if I had time I'd write an answer instead of comment. But I don't have it now sorry. 1) design queue or singleton to serialize access to service 2) cache as needed to avoid duplicate accesses –  gnat Dec 28 '11 at 16:32
I think @gnat is alluding to a Service Locator pattern with his singleton suggestion. One option I haven't seen mentioned is use of a service architecture, like a web service or WCF server/client. –  neontapir Oct 15 '12 at 21:44

1 Answer 1

I don't fathom your intent (and the question title is opaque as well), but if I understand what you are asking WCF supports duplex communication.


If you are running the service (A) and the client (B) on the same box, you can use a NamedPipe binding which is pretty straightforward. There's a tutorial implementation here that might be helpful:


If I've misunderstood your question, please disregard.

share|improve this answer

Your Answer


