[omniORB] IMplementation Repository
Duncan Grisby
dgrisby@uk.research.att.com
Mon, 01 Oct 2001 12:00:12 +0100
On Friday 28 September, "Sveta Shasharina" wrote:
> I have the same problem. Depending on the client decision,
> I will need different servants started. I decided that
> I will create a servant shell, which will have methods like
> string makeServant1(), string makeServant2() etc and return
> the IOR strings allowing the client to get the correct reference.
If you want to return an object reference, you shouldn't return IOR
strings! Just declare the IDL to return the object references
themselves. Either use base Object or, preferably, the specific
interfaces:
interface FirstInterface { ... };
interface SecondInterface { ... };
interface ObjectChooser {
FirstInterface getFirstType();
SecondInterface getSecondType();
};
and so on.
> Am I doing extra work and should look at the Servant Manager?
> Is it the omniORB thing or standard?
Servant Managers are standard things. They are orthogonal to the issue
of creating CORBA objects on demand -- they deal with activating
servants on demand.
Understanding the difference between servants and CORBA objects is one
of the most important issues before you can use CORBA successfully. I
recommend you get and read Henning and Vinoski's book.
Cheers,
Duncan.
--
-- Duncan Grisby \ Research Engineer --
-- AT&T Laboratories Cambridge --
-- http://www.uk.research.att.com/~dpg1 --