View · Search · Index
No registered users in community xowiki
in last 10 minutes

Re: [Xotcl] Issue with mixin delete

From: Scott Gargash <scottg_at_atc.creative.com>
Date: Mon, 8 May 2006 13:42:55 -0600

Gustaf Neumann <neumann_at_wu-wien.ac.at> wrote on 05/06/2006 05:10:24 PM:

> Scott Gargash schrieb:
> >
> > Hello,
> >
> > I've run into an issue when trying to remove a mixin from an object.
> > It appears that removing a mixin from an object interacts with the
> > method chaining, such that the "next" isn't invoked.
> >
> scott,
>
> in your example, you are trying to delete the currently active mixin
> from the mixin list (xotcl needs it
> currently to continue from that point in the mixin chain), and then you
> are deleting the object anyhow.
> Most probably, we should rise an error in such cases.
>
> what is your intention, what lead you to this construction?

In my particular case, I'm manipulating a graph. Some nodes have mixins that are used to notify
other connected nodes. When a node (with this particular mixin) is destroyed, it notifies connected
nodes that it's being disconnected. Another mixin class later in the chain intercepts the destroy
call and moves the node back to a pool (the nodes manipulate a fixed pool of hardware resources, so
they need to be tracked and reused). Since "move" reinvokes the destructor, if I don't remove the
notification mixin from the object, connected nodes are doubly notified (bad), but when I remove the
mixin, I don't get the correct chaining behavior and resource reclamation.

BTW, this will happen with any method, not just "destroy". Is it not considered acceptable to ever
remove a mixin class? When is it valid to remove a mixin if removing it corrupts the method
chaining?

      Scott