#classMethodsChanged when loading from parcels

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

#classMethodsChanged when loading from parcels

Randy Coulman
I'm trying to use CairoGraphics, which uses External-Interface-Pragmas, in my deployed application for the first time.  Everything works fine in a development image, but when I parcel out all my code and try to load it into a base deployment image (or even the stock visual.im), it can't find the Cairo library.

It looks like the problem is that ExternalInterface class>>classMethodsChanged is not getting called when loading CairoGraphics from a parcel, but is getting called (multiple times) when loading from Store.  Why would this be?  #classMethodsChanged _does_ get called (once) when External-Interface-Pragmas itself is loaded, just not when CairoGraphics is loaded.

Is this perhaps related to AR#53000 that was fixed in 7.6?  Is there a fix that I can apply to 7.5 to make this work?

I have some ideas for some hacky workarounds, but I'd rather have a proper fix for it.

Thanks,
Randy
--
Randy Coulman
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [dec07.2]#classMethodsChanged when loading from parcels

Randy Coulman


On Jan 8, 2008 1:30 PM, Alan Knight <[hidden email]> wrote:
When loading from packages it's treating it as an independent series of events, so the creation of the class definition is one thing, and subsequent method creations each trigger the notification. There's stuff in the pipeline for 7.7 that should rationalize a lot of this, and I hope we can get the behaviour consistent. In the meantime, I think you're stuck with using initialize or postLoad:.

Oh, and I should note that class initialize is only called if the class itself implements it, not if it's inherited. See ClassDescription>>postLoad:


So what's the correct way to solve this for External-Interface-Pragmas (and its 7.6 replacement) then?  Should we extract the guts of ExternalInterface class>>classMethodsChanged into a method that is also called from ExternalInterface class>>postLoad: ?  Is postLoad: only called once the entire parcel is loaded, or is called once the class is defined (but before its methods are loaded)?

Is there a better way to solve this?  It'd be nice not to have to do this for every ExternalInterface subclass that uses pragmas to define its libraries.

Randy
--
Randy Coulman
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: [dec07.2]#classMethodsChanged when loading from parcels

Travis Griggs-3

On Jan 8, 2008, at 3:57 PM, Randy Coulman wrote:

>
>
> On Jan 8, 2008 1:30 PM, Alan Knight <[hidden email]> wrote:
> When loading from packages it's treating it as an independent series  
> of events, so the creation of the class definition is one thing, and  
> subsequent method creations each trigger the notification. There's  
> stuff in the pipeline for 7.7 that should rationalize a lot of this,  
> and I hope we can get the behaviour consistent. In the meantime, I  
> think you're stuck with using initialize or postLoad:.
>
> Oh, and I should note that class initialize is only called if the  
> class itself implements it, not if it's inherited. See  
> ClassDescription>>postLoad:
>
>
> So what's the correct way to solve this for External-Interface-
> Pragmas (and its 7.6 replacement) then?  Should we extract the guts  
> of ExternalInterface class>>classMethodsChanged into a method that  
> is also called from ExternalInterface class>>postLoad: ?  Is  
> postLoad: only called once the entire parcel is loaded, or is called  
> once the class is defined (but before its methods are loaded)?
>
> Is there a better way to solve this?  It'd be nice not to have to do  
> this for every ExternalInterface subclass that uses pragmas to  
> define its libraries.

I'd say put a class initialize method that sends classMethodsChanged  
would do it.

--
Travis Griggs
Objologist
If you don't live on the bleeding edge, are you living as a dried wound?