Archived

This forum has been archived. Please start a new discussion on GitHub.

need help

Hai, Marc,Thanks for your reply.
At first I introduce our project. Now we are developing an industrial package which supplies second development function. In this package there is a communication module which supplies a mechanism to connect the up layer system and the lower layer system. At first we planed to use CORBA. But we found that it is so big and complex. So we selected the Ice. The lower system developed based on our package deals with the hardware(machine).The up layer system delivers commands to control the machine through the lower layer system.. The developers of the lower layer system don’t understand Ice and don’t need to write slice files. They will new some objects and methods inherited from the base object supplied by our package. If we use Java, it is very easy to realize converting string(the up layer system’ commands) to object by the reflection mechanism. But we use C++. There is no that kind of mechanism. So it is a key problem to realize the communication module.
I guess Ice maybe supply a kind of mechanism to resolve the problem. But we don’t know how to do. I have read “dynamic Ice”. But it dose not work, I think. So we need your advice badly. Because my English is not good. I wonder whether descript the problem clearly.
Looking forward to your reply.
Best Regards!

Jason

Comments

  • I don't think Ice (or CORBA for that matter) can do what you want. In order to have two processes communicate using Ice, or to exchange instances of objects using the Ice encoding by some other means, both processes must use data types specified with Slice, meaning that both processes depend on Ice.

    (By the way, please do not start a new thread to continue the discussion of a topic. Instead, just reply to the existing thread.)
  • Thanks very much.I got it.We will try to find another way to resolve it through c++.Hope any of your advices.
  • matthew
    matthew NL, Canada
    I'm sorry to tell you this but since C++ has no reflection or introspection what you want is impossible. The data format must be somehow described otherwise it cannot be marshaled or demarshaled.

    So you must make a choice: You can either do this by hand (ie: write code to encode and decode the data yourself), or use some other third party package which will force you do use some type of interface definition language (Ice/CORBA/DCOM/WS, etc).
  • Thank Matthew.
    I just read the chapter 33- “the Ice protocol”. The request message body is:
    Struct RequstData{
    int requestId;
    Ice::Identity id;
    Ice::StringSeq facet;
    string operation;
    byte mode;
    Ice::Context contex;
    Encapsulation params}
    When the server receive the request message, how to locate or find the requestId and the operation. They will be found in ASM?
  • matthew
    matthew NL, Canada
    Before we can help you with any question you must first fill our your signature information as described in the link contained in my signature.

    From your question its also not clear what you really want. In what context do you want to look at this?
  • bernard
    bernard Jupiter, FL
    And once you've entered your signature, don't forget to check the "Show your signature" checkbox in the "Miscalleneous Options" section below the message-posting form.

    Edit: This is now done automatically for all new posts!

    Cheers,
    Bernard
  • rellik78 wrote:
    Struct RequstData{ 
    int requestId; 
    Ice::Identity id; 
    Ice::StringSeq facet; 
    string operation; 
    byte mode; 
    Ice::Context contex; 
    Encapsulation params}
    

    When the server receive the request message, how to locate or find the requestId and the operation. They will be found in ASM?

    I'm not quite sure what you mean here. The above header is simply the information that is presented to the server on the wire. The header tells the server which object the request is for (via the identity), and which operation should be invoked on that object (via the operation name). The server uses the identity to locate a servant (either by indexing into the ASM or by asking a servant locator to provide a servant) and then invokes the operation on that servant, passing any paramaters that were unmarshaled.

    Cheers,

    Michi.
  • Just as you said "operation should be invoked on that object(via the operationn name".I mean,the operation name is a string,how to locate the operation through the string? By function pointer or other ways?
  • matthew
    matthew NL, Canada
    This is all implementation details of the internals of the object adapter and goes far beyond the free support that we provide on this forum. If you are interested in how exactly this works with Ice (and just about every C++ request broker package available) then take a look at the structure of the generated code (for example demo/Ice/hello/Hello.cpp).

    If you need more advice on this topic I suggest taking advantage of our consulting & support services. If you are interested please contact sales@zeroc.com.
  • Thank you very much.I see.