I have been thinking about this for some time, but never got around to discussing it.

Basically this is what makes the RoR lines of code metric so great. The only drawback I see is that you have a loose coupling between the method you want to instantiate: it is based on a string.

I do like the concept, but I wouldn't want to advocate its use too much because of the loose coupling.

This can be a great thing for a productivity enhancing type of project. I think we should discover more about this in our Java 5 compatible release as we then have the full new meta programming stuff available.

Martijn

On 4/1/06, Alex <[EMAIL PROTECTED] > wrote:
Hi,
we've been using wicket for about a month now, so far so good.
The only complain is about code lisibility, sometimes our constructors
are filled with a lot of code, particurally with all the :

add(new Link("myLink")
        {
            public void onClick(RequestCycle cycle)
            {
                // do something here...
            }
        );

The "//do something here" can be quite large. Of course you can put that on a
custom method...
Coming from a WebObjects background, we're used to clean, small Java code
associated with pages (component instanciation, binding data to component, are
in other files).
So we thought a custom component subclassing Link could force this approach :

in constructor :

add(new ReflectionLink("myLink", "myMethod"))

and elsewhere :

public void myMethod() { // do something here ... }

Basically the ReflectionLink would contain some reflection stuff in
onClick(RequestCycle cycle) to invoke our method...

With that you get the separation between "init code" and "action code"

What do you think ?




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



--
Wicket 1.2 is coming! Write Ajax applications without touching _javascript_!
-- http://wicketframework.org

Reply via email to