Home Help Center

Prefixing Ice types & instances

Paul DrummondPaul Drummond Member Paul DrummondOrganization: Iode SoftwareProject: chat room
Hi All,

I am still reading the manual and getting my head around Ice - I am currently looking at the C++ code listRecursive() in Chapter 7 and I started to wonder...

For the following code:
listRecursive(const DirectoryPrx& dir, int depth = 0)
{
    string indent(++depth, '\t');
    NodeSeq contents = dir->list();
    //<<SNIP>>
}
dir->list() is actually executing a Remote Procedure call yet this is not explicit. I think newcomers to the code would benefit from this being explicit but the whole idea of RPC is to make remote calls transparent.

What do you guys do? Do you make your remote calls explicit (by prefixing "ice" or "remote" to the identifier for example)?

Comments

  • michimichi Member Michi HenningOrganization: Triodia TechnologiesProject: I have a passing interest in Ice :-) ✭✭✭
    This is a very old argument: should RPCs be transparent or should they be fundamentally different? The seminal paper is by Waldo, et al.:

    http://research.sun.com/techrep/1994/smli_tr-94-29.pdf

    Personally, I disagree with their conclusion. Of course, you cannot design a distributed system the same way as a non-distributed one. But the conclusion that, therefore, the APIs should somehow be fundamentally different doesn't follow (and is poorly justifed by the paper, IMO).

    And, when you look at the Ice APIs, there are already quite a few hints that the call will go remote. In particular, the only way to invoke a remote operation is make the call via a proxy of type <something>Prx. That's a pretty strong hint that we are not dealing with a local method invocation. Beyond that, I don't see why the APIs should look any different than they do--to me, making them different would just be throwing rocks into the developer's path.

    So, I would advise against prefix all Slice operations or some such--it's not going to improve anything, and it will make the code more cluttered.

    Cheers,

    Michi.
Sign In or Register to comment.