Archived

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

Local interface

I'm wondering if it makes sense to create a local interface. I plan to create session facades for a servant that controls a camera. I don't want the camera object to be visible across the network; access should only be via the facades. I know I could just use a C++ interface locally, but then I have to translate exceptions thrown by the C++ class into Ice exceptions, and also translate enums, and perhaps other data types. Maybe not a big deal, but I don't like having to do it.

My thought was that if I define an Ice local interface for the camera, implementations of it can have an interface that is compatible with the session facades, yet those objects will be invisible to other Ice entities.

Is this a reasonable use of local interface?

Thanks.

Comments

  • marc
    marc Florida
    I don't really understand what you mean with session facades. In any case, Slice local interfaces simply define a base class or interface that you must then implement locally. There is nothing else to it. In particular, Slice local interfaces can not be used to implement servants, and therefore they can also not be used to implement Ice objects. They are simply an aid to construct local programming language objects using the standard Slice language mapping rules.
  • marc wrote: »
    I don't really understand what you mean with session facades. In any case, Slice local interfaces simply define a base class or interface that you must then implement locally. There is nothing else to it. In particular, Slice local interfaces can not be used to implement servants, and therefore they can also not be used to implement Ice objects. They are simply an aid to construct local programming language objects using the standard Slice language mapping rules.

    Sorry, this is in relation to: http://www.zeroc.com/vbulletin/showthread.php?t=2763&highlight=facade

    I understand that local interfaces can't be implemented as remote Ice servants. The idea is that a facade is an Ice servant that is visible over the network and controls access to the local Ice object using the same data types and exceptions as are exposed over the network in the servants. I don't want the local object visible on the network, but I want it to be compatible with the facade servants.
  • marc
    marc Florida
    Yes, you could use local interfaces for that. However, I'm not sure if this would be of any benefit to your application. You can use the Slice data types and exceptions that you define for your facade in your programming language objects, regardless of whether you use local interfaces. What value would local interfaces add?