[omniORB] Collocation: call on servant directly or via object reference ?

Lars Immisch lars@ibp.de
Sun Jul 7 02:14:01 2002


Dear Brecht,

>I know this question is not purely omniORB specific (although there will
>be omniORB specific things probably), but nevertheless I think some
>people have some good ideas on this.
>
>The situation is as follows (simplified): a CORBA server has two
>different CORBA objects with different IDL interfaces and one object
>needs to call operations on the other.
>
>What are the advantages/disadvantages of using calls directly on the
>servant (via C++ pointer) or operations on a CORBA object reference
>(obtained via _this() e.g.) ?

Hmmm. If you are asking if C++ method calls will be faster than CORBA 
invocations (no matter how optimised), then the answer is: C++ method calls 
will always be faster. If the ORB is really aggressive about optimization, 
they might not be much faster, but faster they will be.

The downside is that the servant you are directly invoking is not location 
transparent, so if you want to move that servant to another 
machine/process, you will have to rewrite your code to invoke operations 
via CORBA.

- Lars