Hints on the use of create vs. create_constant

Enough context now exists so that the following question may be answered: "If object references constructed with create support changeable ReferenceData, but object references constructed with create_constant do not, why would I ever want to use create_constant?"

Invocations of create add entries to a table called the ReferenceData Table. The ReferenceData Table is persistent; that is, ReferenceData saved in it persists between server activations. Two calls to create with the same arguments do not return the same SOMDObject (per CORBA 1.1 specifications) That is, if create is called twice with the same arguments, two entries in the ReferenceData Table will be created. If a server using create wishes to avoid cluttering up the ReferenceData Table with multiple references to the same object, it must maintain a table of its own to keep track of the references it has created to avoid calling create twice with the same arguments.

The create_constant method stores the ReferenceData as part of the SOMDObject's state; that is, it does not add entries to the ReferenceData Table. The create_constant method, then, might be used by a server that does not want to maintain a table of references nor pay the penalty of cluttering up the ReferenceData Table with multiple entries.


[Back: Mapping objects to object references]
[Next: Mapping object references to objects]