Solved

Best way to make a single object instance public to other processes ?

Posted on 2016-09-16
7
35 Views
Last Modified: 2016-10-09
Hello Everyone,

I would like to ask you what is the best way to make a single object instance public to other processes ?  
As COM server exe is not directly foreseen is WCF still the right candidate ?

What do you think ?
Thank you very much in advance
Best regards.
MiQi.
0
Comment
Question by:festijazz
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 8

Expert Comment

by:Prakash Samariya
ID: 41801427
You might looking for Singleton Pattern which allow only one instance!
Please check below link
Implementing the Singleton Pattern in C#
0
 
LVL 1

Author Comment

by:festijazz
ID: 41801438
Hello Sir,
Thank you for your reply but I do not see how I will be able to inter link two process via the solution you propose.

A process needs to access an object defined and instantiated in another process.

What do you think ?
 Thank you very much in advance
 Best regards.
 MiQi.
0
 
LVL 8

Expert Comment

by:Prakash Samariya
ID: 41801682
Can you describe your need?
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 28

Expert Comment

by:pepr
ID: 41803049
Actually, a process is isolated from other processes by definition. The only way to share the information is through the data transfer.

In other words, the shared information is or a persistent data structure (information from the stared database, shared file, etc.), or the active object is encapsulated in the dedicated (another) process, and you use some communication protocol to ask for the info and get the information back.
0
 
LVL 33

Expert Comment

by:sarabande
ID: 41805227
you may use named shared memory for your purpose, if the object is a data structure. either process could map to the shared memory by name. the first process would copy the shared data to the memory (with or without parameters to control access or synchronisation). either process could have a pointer to the shared instance.

if the object also is code, you could manage it in a service and provide data + functions.

Sara
0
 
LVL 1

Accepted Solution

by:
festijazz earned 500 total points (awarded by participants)
ID: 41805522
Hello everyone,
thank you for all inputs but I have found the solution by googling on the web.
The solution I need to use is .NET remoting.
I can post you an example if needed.

Best regards.
MiQi
0
 
LVL 33

Expert Comment

by:sarabande
ID: 41835694
The Asker told us that they found a solution by using the .NET Framework.

I don't think that any of the other comments could be called a solution or assist.

Sara
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question