[omniORB] late servant construction

Renzo Tomaselli renzo.tomaselli@tecnotp.it
Fri, 4 May 2001 11:18:12 +0200


Hi,
    I'd like to collect a few comments about the issue of delaying servant
construction as much as possible, as opposite to the standard way of first
building a servant and then getting its ref through _this(). I found this
"late binding" approach much effective with 2.8, by building a "synthetic"
IOR (by predating genior) which will be returned from the method being
actually invoked. Then I use the 2.8 hook to buildup the servant when really
invoked (first "touch"), at the price of an extra location forward.
This approach turned out useful to mitigate the problem of destroying
servants when they must be returned but not necessarily needed (such as when
they are embedded into structures/sequences). In short, the evictor pattern
problem.
Now I know I will have to use a ServantLocator for 3.x instead of the
proprietary hook and that's fine.
Then is that true I can generate the objref in a portable way by creating a
Corbaloc string and then converting it to an obj ref? (I know there is a
small further price to pay because the missing type info will force an is_a
call). Any missing tip, trick, etc. ?
Thanks,
                                             Renzo Tomaselli
---------------------------------------------------------------------------
TecnoTP s.n.c. Special Information System Design
Maso Pelauchi I38050 Ronchi Valsugana,  Trento TN  ITALY
Tel. +39 0461 773164      Fax. +39 0461 771514
e-mail: renzo.tomaselli@tecnotp.it
---------------------------------------------------------------------------