[omniORB] Calling obj_is_ready

David Riddoch djr@uk.research.att.com
Fri, 25 Jun 1999 17:31:30 +0100 (GMT)


On Fri, 25 Jun 1999, Armen Yampolsky wrote:

> I am wondering, just out of curiousity, and also to understand the CORBA
> spec a little better, why ORB vendors do not call obj_is_ready from the
> constructor of the servant's generated superclass? I have come across
> postings from Michi Henning in which he actually recommends making the
> call from the constructor of the implementation class. So I was
> wondering why, by extension, it isn't simply done by the generated
> class, removing that task from the implementation programmer. As far as
> I can tell, there is no way that the servant could be referenced by the
> client prior to the completion of its constructor anyway. What am I
> missing?


Hi Armen,


You might not want to activate your object straight away -- there may some
further initialisation you need to do outside of the constructor, or some
other objects which this depends on may need to be activated.  If we put
obj_is_ready in the constructor it would just take flexibility away from
you.

What is worse, by the time your constructor code was executed the object
would already be activated.  Therefore you could be dispatching CORBA
calls before you've even initialised your object.  Don't forget, it is
possible to have references to objects which have not yet been activated.
This is especially easy with the POA.


David