Lazy Loading (was: Re: [squeak-dev] The Trunk: MorphicExtras-cmm.131.mcz)

Chris Muller ma.chris.m at gmail.com
Mon Dec 9 21:18:31 UTC 2013


>>> I think lazy loading like this should be a last resort. Surely we can do better?
>>
>> Why should it be a last resort instead of a first resort?  What do you
>> propose for better?
>
> Well, I don't have a monopoly on good ideas :). But how about this: if it's that important that you go to the trouble of hooking in a lazy load, why not just load the package in eagerly?

Because Nicolas wants to eliminate MorphicExtras static dependency on
UpdateStream, which is what started this thread.

You contend lazy loading doesn't eliminate the dependency, it only
defers it until runtime.  That's true, but how else could the
_original_ behavior be met?  Nicolas proposed that it shouldn't
anyway:  Change the original behavior.

In this case, I agree with him.  System initialization of this sort
can be done myriad of ways -- we don't need lazy-loading for this
case.  But it is good to remember this is a tool in our toolbox toward
achieving the same goals as the modularity effort.  -- I think your
expression of it being an additional "dependency" on the Internet is
not true.

Sometimes the modularization effort employs only "pure package
factoring" (preserving original behaviors).  Sometimes chopping out
behaviors to eliminate dependencies becomes necessary.  Ok, I
understand now why you "last resort" and I agree, but it _is_ useful
at times.


More information about the Squeak-dev mailing list