<br><font size=2 face="sans-serif">As I understand it, precedence order
is computed as filters then mixins the superclasses, and this sort order
is applied &quot;globally&quot; to an object. &nbsp;</font>
<br>
<br><font size=2 face="sans-serif">In other words:</font>
<br>
<br><font size=2 face="sans-serif">Class create Base</font>
<br><font size=2 face="sans-serif">Class create Derived -superclass Base</font>
<br><font size=2 face="sans-serif">Derived d</font>
<br><font size=2 face="sans-serif">d info precedence ==&gt; ::Derived ::Base
::xotcl::Object</font>
<br>
<br><font size=2 face="sans-serif">Class create BaseMixin</font>
<br><font size=2 face="sans-serif">Base instmixin add BaseMixin</font>
<br><font size=2 face="sans-serif">d info precedence &nbsp;==&gt; ::BaseMixin
::Derived ::Base ::xotcl::Object</font>
<br>
<br><font size=2 face="sans-serif">This behavior seems to violate encapsulation.
BaseMixin is intended to intercept messages to Base. Derived doesn't know
about BaseMixin and BaseMixin doesn't know about Derived, yet BaseMixin
ends up being the first interceptor of messages to Derived.</font>
<br>
<br><font size=2 face="sans-serif">Since BaseMixin is intended to modify
the behavior of Base, it would be better BaseMixin preceeded Base (and
only Base) in the sort order. &nbsp;</font>
<br>
<br><font size=2 face="sans-serif">d info precedence &nbsp;==&gt; ::Derived
::BaseMixin ::Base ::xotcl::Object</font>
<br>
<br><font size=2 face="sans-serif">The current behavior means you can't
really add a mixin without understanding everywhere that the object being
extended is used. Is there some benefit to the current behavior that I
don't understand?</font>
<br>