Attribute loading

Antonio Ramirez writes:
 > 
 > Hi,

Hi Anto,

Sorry for the delay...

 > Is there a way to obtain the resource when an attribute is unpickled?
 > (The resource that it belongs to?). The problem that I have is that,
 > in the changes that I'm making to SSIResource, I need to have access
 > to the CommandRegistry in order to unpickle the segments. And the only
 > way to get the command registry is to ask the resource for it. The
 > other thing that complicates matters here is that the only way that
 > the SSIResource can get the command registry is by getting the
 > registryClass attribute, so this seems sort of a circular thing. (At
 > attribute load time, I need access to the command registry, but this
 > needs a different attribute to be loaded).

One work-around is to override the pickle/unpickle methods of the
resource itself. But that's a tough decision (I am not sure I would
recommend this). On the other hand, attributes are meant to be
"resource-independent" by definition (and this might be important,
even though I am rather unsure), and your attributes are clearly not.

BTW: don't you have a pointer to the CommandRegistry in the segments ?
Couldn't you add one there ?

Anselm.

Received on Tuesday, 3 December 1996 04:48:33 UTC