What about if we modify this idea a bit?  What if we use dynamic
proxies to make it more generic?  So, your onclick method would look
like:

public void onClick(AjaxRequestTarget target) {
  fire(MyCustomEventListener.class).someAjaxEvent(target);
}

Then, the fire() method would return an object (a dynamic proxy) that
implements the MyCustomEventListener interface.  The method
implementation would do the visitor thing by looking for all
components implementing the MyCustomEventListener interface and then
call the someAjaxEvent() method.

On Wed, Aug 25, 2010 at 5:10 AM, vladimir.kovalyuk <koval...@gmail.com> wrote:
>
> I don't like subscriptions implementation. Somewhen it becomes difficult to
> realize when to add/remove observers. It depends on the order of
> instantiations. Visitor pattern seems to be much more reliable.
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Best-practice-for-component-interaction-tp2336888p2337874.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to