in fact, i wish i could make these interfaces private and still use them across packages in the core.
i've heard rumors that this kind of thing might be in 1.6... i wish we had it now! ;-(
Jonathan Locke wrote:
in fact, i want to do this to each such interface.
and gili, i should point out, this is an implementation detail. clients of the framework should never care about this!
Jonathan Locke wrote:
i have to say i strongly disagree. you cannot do it in onClick because a million different components are going to override that. and the whole super.x() mess is definitely something to be avoided.
i'm +10000 on this. nobody should directly override the interface method because that's internal plumbing.
Gili wrote:
I'm actually -1 on this one. I don't like having this extra layer. Besides, I feel you can accomplish the click counting that you mentioned by simply implementing onClick(), leaving the class abstract, and having users that extend the class invoke super.onClick() to inherit this behavior.
Gili
On Mon, 14 Feb 2005 12:27:32 -0800, Jonathan Locke wrote:
ooh ooh. besides being elegant and consistent, i think we got something cool for free here. consider this:
if we wanted to do link click counting, it would be completely trivial to add it that functionality to onLinkClicked (the interface method) and it would work for all links on a site/application regardless of how they are implemented. we could even come up with little reports by link subclass... nifty!
Jonathan Locke wrote:
i just tried this in Link and it works out fine. you can't get confused by the onLinkClicked interface method because it's final. shall i check this in? i think it makes everything consistent myself.
/** * Called when a link is clicked. * * @see ILinkListener */ public final void onLinkClicked() { onClick(); }
/** * Called when a link is clicked. */ public abstract void onClick();
Jonathan Locke wrote:
actually, we do have onFormSubmitted. the onXYed() pattern is used pretty consistently for interface methods and i think we should keep that unabbreviated to keep it obvious and also due to the tendency for interfaces to conflict.
anyway, there is a pattern of consistency here that you're not seeing. and we don't want to over-abbreviate things. and we do want to get the verb tenses right.
rather than arguing case by case, as we have been, i'd like to present the overall scheme so we can get it right once and hopefully stop renaming stuff.
so here's the list of methods we've got and the once rename i think should happen and why
// These look fine to me IChangeListener.onChange() RequestCycle.onRender() Component.onRender() Component.onComponentTagBody() Component.onComponentTag()
// All totally consistent. These are called directly by the framework when the request comes in. We should leave these alone.
IRedirectListener.onRedirectRequested()
IResourceListener.onResourceRequested()
IFormSubmitListener.onFormSubmitted()
IOnChangeListener.onSelectionChanged()
ILinkListener.onLinkClicked()
// These look fine to me FormComponent.onInvalid() FormComponent.onValid() Form.onError() Form.onSubmit() Button.onSubmit()
// We could/should add this, but leave the onLinkClicked interface method the same. The final concrete implementation in AbstractLink of onLinkClicked would simply call the abstract method onClick(), which would give us a valuable place to do stuff within the framework on every link click in the future. Make sense?
Link.onClick()
// Leave these since a shorter name would be confusing, especially with IChangeListener.onChange() around... Also, there is a certain consistency here because all the other onX() methods like onValid(), onSubmit(), onLink() etc. implicitly have the name of their class as the target. In DropDownChoice, it's not the DropDownChoice that changed. It's the selection. So i'd consider just leaving this.
DropDownChoice.onSelectionChanged()
DropDownChoice.onSelectionChanged(Object)
Martijn Dashorst wrote:
+1 ;-)
Martijn
Jonathan Locke wrote:
okay, since we're doing this, are we good with onAttach/onDetach too? ;-)
Martijn Dashorst wrote:
In order to get things *really* consistent, is it possible to rename Link.onLinkClick to Link.onClick?
I gather we don't have Form.onFormSubmit and Button.onButtonClick.
Martijn
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
