How can I get apps on different platforms to communicate?

Chuck Kvasnicka 40 Reputation points
2024-06-24T15:11:27.5633333+00:00

I wonder if there is anyone out there who can help me with a solution to an application I want to create.

 This solution will contain two separate platforms, communicating with each other via network, serial ports, or something else. The first platform is a Windows platform and I will be using C#. The second platform is not a Windows platform, and I will be using C++. So, to state the problem as simply as possible;

 I will create a class to use on the first platform we can call ClassA, with several member functions, such as FuncA1, FuncA2, etc... We can create any number of objects from this class, such as ClassA_Obj1, ClassA_Obj2, etc.

 I will create a class to use on the second platform we can call ClassB, with several member functions, such as FuncB1, FuncB2, etc... We can create any number of objects from this class, such as ClassB_Obj1, ClassB_Obj2, etc.

 There should be no naming restrictions on any of the above classes, objects, or functions. There should be no restrictions on the number of objects created from either class. All of the above is a framework to be used for new applications. The idea is that one object from each platform can call the functions of one another, but not from any other object.

 This is my dilemma: I don’t want to use ‘if’, or ‘switch’ statements. I don’t want to have to build a table for every application created off of this framework. My intent is to build a framework that can be shared with other developers.

 Does anyone know of a link to a video, paper, explanation, or example on the Internet that illustrates a solution to this problem?

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,551 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,607 questions
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 59,721 Reputation points
    2024-06-24T15:57:42.4733333+00:00

    this is generally referred to as a remote procedure call (RPC). there have been many implementations of this feature: SUN RPC, SOAP, REST api, gRPC, ....

    The main design decision is how objects are serialized and de-serialized to pass over the wire. as for dispatch mapping, reflection is used in languages that allow reflection.

    The client must know something about the service it is calling. SOAP uses a meta language to define the protocol, and a code generator for the caller. REST uses standard JSON serialization, and defining url (again a code generator is available).

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful