Hi Thiago, On Tue, Aug 30, 2011 at 6:41 PM, Thiago H. de Paula Figueiredo < [email protected]> wrote:
> On Fri, 26 Aug 2011 08:12:10 -0300, Dragan Sahpaski < > [email protected]> wrote: > > OK I can see the problem here. But what do you think about the newly >> proposed concept to be able to apply a mixin to the component, and all of >> its embedded components. Its touching the inner structure, but I think it >> is just enough to be acceptable. >> > > I like it. I'd just call it recursive mixin and, instead of creating > another annotation for it, we would create properties in the @Mixin > annotation, something like @Mixin(recursive = true, filter = {Class1.class, > Class2.class}), recursive and filter being optional, recursive having > default value of false, filter having a default value of null (no > filtering). Recursive mixins would be applied to the component and their > embedded component instances, as long as they are assignable to at least one > of the classes in the filter property (as long as it isn't null). >From the current implementation of @Mixin, this annotation can be applied only on mixin fields in a component, which defines an implementation mixin. Your proposal could be used only if the @Mixin annotation can be applied to the actual Mixin class. I like the idea of applying the recursive mixin behavior on implementation and instance mixins also not only "hardcoded" in the mixin class. Do you think we should allow applying @Mixin on the mixin class also? If you think this won't produce confusion I'm all for it, and willing to work on it. Cheers > > > After all as Kalle said using advices and >> mixins on render methods assumes knowledge on what is going on in the >> implementation of a component. >> > > I disagree with this argument. Mixins are based on render events, which are > the same for every Tapestry component. I'd agree if we were talking about > mixins that change the output of a component, not just decorating it, but > that's not very used (but still very useful). > > -- > Thiago H. de Paula Figueiredo > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, > and instructor > Owner, Ars Machina Tecnologia da Informação Ltda. > http://www.arsmachina.com.br >
