Archived

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

some design issue on distributed filesystem

I wanna extend distributed filesystem's design, which may have object classes more than just only file and directory, so i wanna add a addNode() method in the directory interface, which means i create the node in the client side, and send this object to server via parameters of addNode(). For I donnot know what exactly the object class is, so my addNode() should be like this: void addNode(NodeI obj), because NodeI is inherited from PersistentNode, so there will be some status be tranfered to server. but how does server side down cast the incoming obj to what it should be? or there are better design?

Comments

  • I'm not sure I fully understand your question. But, in general, to down-cast a class or a proxy on the server side, you use a dynamicCast. For a proxy to an interface I, use
    Ice::ObjectPrx obj = ...;
    IPrx p = IPrx::dynamicCast(obj);
    
    For a class C, with an implementation CI, use
    typedef IceUtil::Handle<CI> CIPtr;
    Ice::ObjectPtr obj = ...;
    CIPtr p = CIPtr::dynamicCast(obj);
    

    Cheers,

    Michi.