STBInFiler enhancements

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

STBInFiler enhancements

James Foster-3
I've observed some problems with STBInFiler when I have circular references
among proxies. The problem is that replacing the proxy with the model in the
readMap happens after the instance variables are read. Of course, this is
partly necessary since until some of the instance variables are read one
doesn't know enough to find or create the model. Unfortunately, the process
of reading instance variables into the proxy can bring in other objects that
reference the proxy. Thus, by the time the proxy is fully loaded it is
already referenced and it is too late to replace it with the model in the
readMap. One solution is #oneWayBecome: which is slow and I try to avoid.

The attached contains a STBInFilerEx which overrides #basicNext to give the
object being built a chance to update the readMap before all the instance
variables are loaded. This allows properly defined proxies to load cleanly
with circular references.

STBInFilerEx also includes a valueHolder instance variable that is updated
with the position in the file. This allows for a ProgressDialog to be used
to show the progress of a load. An example is included.

This package also includes a way to set the current working directory and
Collection>>#any.

I respectfully submit it for consideration into the base distribution.

James Foster
Fargo, ND






















begin 666 DolphinEx.pac
M?"!P86-K86=E('P-"G!A8VMA9V4@.CT@4&%C:V%G92!N86UE.B G1&]L<&AI
M;D5X)RX-"G!A8VMA9V4@<&%X5F5R<VEO;CH@,#L-"@EB87-I8T-O;6UE;G0Z
M("<G+@T*#0IP86-K86=E(&)A<VEC4&%C:V%G959E<G-I;VXZ("<P+C P,2<N
M#0H-"B)!9&0@=&AE('!A8VMA9V4@<V-R:7!T<R(-"@T*(D%D9"!T:&4@8VQA
M<W,@;F%M97,L(&QO;W-E(&UE=&AO9"!N86UE<RP@9VQO8F%L(&YA;65S+"!R
M97-O=7)C92!N86UE<R(-"G!A8VMA9V4@8VQA<W-.86UE<PT*"6%D9#H@(U-4
M0DEN1FEL97)%>#L-"@EY;W5R<V5L9BX-"@T*<&%C:V%G92!M971H;V1.86UE
M<PT*"6%D9#H@(T-O;&QE8W1I;VX@+3X@(V%N>3L-"@EA9&0Z("-+97)N96Q,
M:6)R87)Y("T^("-S971#=7)R96YT1&ER96-T;W)Y.CL-"@EA9&0Z("-/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