Results 1 to 2 of 2

Thread: Client-side objects

  1. #1
    Kenni is offline Registered User
    Name: Kenni Thomsen
    Organization: SDU Denmark
    Project: Distributed programming with Gumstix
    Join Date
    Nov 2008
    Posts
    2

    Client-side objects

    Hello.



    I'm still new to this Ice-universe, but I have played around with it a bit, so now I have a question.


    In all the demo's I have tried I can see that the object is created on the server-side and the client then uses the functions in that object. In the hello-demo the object = new HelloI; is on the server-side and the client uses the function hello->sayHello() to say hello on the server.
    Is it possible to make this so, that the object would be on the client side, so that the client sends an object or similar to the server and the server then executes the stuff inside the object? The server-side should only know that there is a function sayHello() but not what it does. The sayHello() could just print a string like the demo or it could do some calculations and then print the result?

    I use Ice-E on a Gumstix and on PC with Ubuntu. My programs are in C++.

    Maybe this question have been answered before but I couldn't find any that matched this, but I might have searched with the wrong words!?

    Thanks for any help in advance.
    Kenni

  2. #2
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    With Ice you can pass objects by proxy, or by value. See my article Proxies in http://www.zeroc.com/newsletter/issue23.pdf for more details about proxies.

    If you pass an object by proxy, you are providing the recipient of the proxy the means to execute methods on the Ice object referred to by that proxy.

    Code:
    interface Action
    {
      void doit();
    };
    
    interface Execute
    {
      void ex(Action* action);       
    };
    In this case the Action object is passed by proxy to the ex operation in the Execute object. When "pass by proxy" is used, the Ice object itself does not go over the wire, only information used to make invocations on that Ice object (the identity, facet, and optionally location information).

    If you pass an object by-value, then you are passing the object itself over the wire. In this case, assuming the object is abstract (that is, has operations) the recipient must provide an implementation of the object through an ObjectFactory.

    Code:
    interface Execute
    {
      void ex(Action action);
    };
    This this case Action is passed by value. The recipient must provide an implementation on this interface. There is no automatic way, and nor would it be safe to do so in any case, to pass the implementation of the object over the wire. In a strictly controlled environment you could do this yourself, however.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 10-30-2007, 04:45 PM
  2. Client side invocations from a Server app.
    By vincei in forum Comments
    Replies: 3
    Last Post: 07-04-2007, 09:27 AM
  3. Replies: 3
    Last Post: 03-13-2006, 02:49 AM
  4. OutOfMemoryError Exception in the client side
    By lucsat in forum Help Center
    Replies: 4
    Last Post: 01-03-2006, 07:20 AM
  5. client-side thread safety
    By fitzharrys in forum Help Center
    Replies: 1
    Last Post: 07-06-2005, 10:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •