Login  Register

#become: and #oneWayBecome:

Posted by Esteban A. Maringolo-2 on Jan 12, 2005; 1:44pm
URL: https://forum.world.st/become-and-oneWayBecome-tp3372645.html

Hi,

    reading the method comment of #oneWayBecome: it mentions about
the efficience of the implementation.
       
        I quote:

"[SNIP]
This method should be used with care, but is some what less
dangerous than #become:, as it does not affect existing users of
anObject. Currently the implementation is not as efficient as #become:."

        What kind of efficience does it refers?

        I'm using #oneWayBecome: to transform stubs (Subclasses of
ProtoObject) into concrete objects, the stubs represents "external
objects" which are loaded at demand.

        But i'm not very sure about the "pointing" of the objects.

        E.g.
        objectA (concrete)
        otub1 (of objectB)
        stub2 (of objectA)
        stub3 (of objectA)

        If stub2 becomes the concrete objectA, so all what where pointing
to stub2 now points to objectA. If I want to preserve identity and
contents and objectA, when stub3 becomes the existing objectA it
should do it using #oneWayBecome:, am I right?

        What should I do if I want that all what points to anStub points to
nil?

        Thanks in advance.


--
Esteban A. Maringolo
[hidden email]