How does Tapestry mixin work?

After reading this article , I just realized that I can’t explain to myself how it works and what problems it can solve.

Yes, it can be used to change the behavior of an existing component. But how is it limited? What can I do, and what can I not do? Is this better than inheritance?

This article is helpful, but I'm still very confused.

Can someone explain mixin tapestry with simple words ?

+6
source share
1 answer

Tapestry Mixin is a limited version of a component that must be attached to another component and cannot have its own template. He has access to the parameters of the container and can submit his own. This is no better than inheritance. This is another way to change component behavior.

So what can you do with mixins that cannot be done with inheritance:

  • You can change the behavior of the tapestry components.
  • you can use several mixes for one component

Some other words about mixinns:

  • they usually introduce some general logic that can be applied to all components, for example. send the form to any client event or attach a pop-up window using for any field.
  • they can fix some problem with the main components, for example. we have a mixin that captures the load component when it is used in ajax form.
+7
source

Source: https://habr.com/ru/post/949087/


All Articles