You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Geoffrey Wiseman <ge...@gmail.com> on 2009/07/13 23:17:37 UTC

Mixin Order

Is there a way to control the order of mixins?  I've declared them in a
particular order, and it looks like Tapestry's applying them in reverse
order -- I could reverse the order of declaration, but I was just wondering
whether or not there's any guarantees here, or if I'm essentially relying on
something I shouldn't be ...

  - Geoffrey
-- 
Geoffrey Wiseman
http://www.geoffreywiseman.ca/

Re: Mixin Order

Posted by Robert Zeigler <ro...@scazdl.org>.
Hi Geof, the only ordering tapestry does is to ensure that mixins with  
"@MixinAfter" are applied correctly.
Otherwise, I the order is basically a crapshoot.  I had always assumed  
that mixins would be applied in the order specified, but from a recent  
perusal of mixin-related code, I've found that's not so.  But there  
are difficulties with this because the mixins to apply can come from  
multiple sources: the t:mixins element in the template, the @Mixins  
annotation on a @Component instance, or the @Mixin annotation within a  
component class ("implementation mixins").  So the question for  
ordering becomes how to properly order the disparate sources of  
mixins.  For example, you could order as:
   template (in order specified), @Mixins annotation (in order  
specified in the annotation), @Mixin classes (in order specified  
within the component class).
Or maybe:
   @Mixins, template, @Mixin

Or... :)

Please open a jira for proper ordering of mixins; I'll be interested  
to see opinions on what is the "right" mixin ordering.

Robert

On Jul 13, 2009, at 7/134:17 PM , Geoffrey Wiseman wrote:

> Is there a way to control the order of mixins?  I've declared them  
> in a
> particular order, and it looks like Tapestry's applying them in  
> reverse
> order -- I could reverse the order of declaration, but I was just  
> wondering
> whether or not there's any guarantees here, or if I'm essentially  
> relying on
> something I shouldn't be ...
>
>  - Geoffrey
> -- 
> Geoffrey Wiseman
> http://www.geoffreywiseman.ca/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org