Re: #become: and #oneWayBecome:
Posted by Chris Uppal-3 on Jan 14, 2005; 12:15pm
URL: https://forum.world.st/become-and-oneWayBecome-tp3372645p3372692.html
Esteban,
> Well... actually they're not proxies, They're "stubs" (i don't know
> if there is a lot of semantic difference).
OK. I tend to use the word "proxy" for everything, but I think you are right.
> Once anORPStub receives a message (which should go to it's subject)
> it will lookup in the session object registry (a kind of cache)
> using it class and key, if the session doesn't find it in it's cache
> it will lookup in the storage (SQL by now), if doesn't exists, it
> will answer nil, or the object (new or cached). The stub will become
> (oneWay) the object answered.
Reading your reply to Blair, it sounds as if you've decided to change that
design a bit. I just wanted to add that if you can control the referential
integrity in the DB closely enough, then you could ensure that you never create
a stub for data that will (later) turn out not to exist. I.e. you would use
nil instead of a stub if there is a NIL reference in the database, otherwise
create a stub which will assume that it can read in valid data later (and will
throw an error if that fails).
> Yes... i tend to have a "virtual nothing" in almost everything, an
> object that is to my domain as nil is to smalltalk. But as continue
> learning, i'm not reinforcing that approach.
Odd that. I started out not using them much, but find that I'm using them more
and more as time goes on... Maybe we'll meet somewhere in the middle ;-)
> > > Is possible to make a trick to speed up the proccess of
> > > #oneWayBecome: using a combination of #becomes:'s... or similar
>
> > I don't believe so. And if there was, surely Blair would be using the
> > trick to speed up #oneWayBecome: in the VM already ;-)
>
> Of course, my suggestion was ingenuous, but one never knows... :-)
I'm sorry. I misread you as asking /whether/ such a trick existed; I didn't
realise you were saying you had already /found/ one. What is it please ?
(Unless the "entropy" argument has persuaded you that it won't work).
-- chris