Regarding the newly added 'around functionality' of WebRequestCycle and WebPage.

I certainly welcome this addition in the background of Spring integration and 
AOP, but I see some problems with this implementation.

First of all we now have a new dependency to HTML markup in 
WebRequestCycle.java:

import wicket.markup.html.WebPage;
....
if (page instanceof WebPage)
{
((WebPage)page).beforeCallComponent(component, method);
}
......
if (page instanceof WebPage)
{
((WebPage)page).afterCallComponent(component, method);
}

Secondly WebPage.java has a new dependency on java.lang.reflect:

import java.lang.reflect.Method;
....
public void beforeCallComponent(final Component component, final Method method)
public void afterCallComponent(final Component component, final Method method)

IMHO this lifecycle notification would be solved more elegant, if the latter 
two methods were moved into WebRequestCycle instead, serving as hooks:

/** Unchanged javadoc **/
protected void beforeCallComponent(final Component component, final Method 
method) {}
/** Unchanged javadoc **/
protected void afterCallComponent(final Component component, final Method 
method) {}

I see the following benefits:
- no new dependencies as described above
- the reflection stuff is isolated in WebRequestCycle, were it's already used
- more flexible since project specific subclasses of WebRequestCycle could 
easily
... apply their aspects (e.g. inject dependencies with Spring) from *outside* 
of their pages
... forward these lifecyle notifications into their pages (as the current 
implementation) if they really need to.

Please reread the javadoc of beforeCallComponent() and afterCallComponent() as 
if they were already located in WebRequestCycle, IMHO they make much more sense 
there.

Thanks

Sven


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to