>
> The extra memory for the ClickListener is negligible and does give you
> more flexibility because now you can have more than one interested party
> for the link click. My use case (fetch nested component, add listener)
> was already answered sufficiently by Martijn (bad OO, components should
> publish own events that make sense in the problem domain), but I still
> an eventlistener-based design could have merit (see the move towards
> Delegation Event Model in AWT:
> http://java.sun.com/j2se/1.3/docs/guide/awt/designspec/events.html).
> While wicket is not swing or awt, it's an interesting read.



with the link abstract class you don't have any extra memory overhead
but with the listener interface you have quite a lot because you need
and extra reference in link itself, that holds an extra List (that again has
its own stuff)
and then you have an extra instance of the listener itself which by itself
has its internal representation
Don't underestimate this. especially because we also can use them in
tableviews with a lot of cells.

But as i said, if you want a listener interface then you can build it quite
easily

johan

Reply via email to