You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Martin Grigorov <mg...@apache.org> on 2014/07/18 09:39:07 UTC

Rename DisabledLinkBehavior

Hi,

At
https://issues.apache.org/jira/browse/WICKET-4904?focusedCommentId=14059918&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14059918
Garret Wilson makes a good point that the name of DisabledLinkBehavior is
probably a bit confusing. The name suggests that this is the recommended
way to disable links.

Here are my suggestions to improve this:
1) rename to Wicket6DisabledLinkBehavior + javadoc update explaining that
this is how links were disabled in Wicket 6
2) rename to LegacyDisabledLinkBehavior + javadoc update explaining that
this is how links were disabled in Wicket 6
3) javadoc update explaining that this is how links were disabled in Wicket
6

In case of 1) or 2) we will update the migration guide too.

Other ideas ?

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

Re: Rename DisabledLinkBehavior

Posted by Martin Grigorov <mg...@apache.org>.
On Fri, Jul 18, 2014 at 11:05 AM, Sven Meier <sv...@meiers.net> wrote:

> Hi,
>
> 3.5) Improve the javadoc and deprecate the class too, so users know they
> should move away from it.
>

I like this suggestion!


>
> My 2 cents
> Sven
>
>
>
> On 07/18/2014 09:39 AM, Martin Grigorov wrote:
>
>> Hi,
>>
>> At
>> https://issues.apache.org/jira/browse/WICKET-4904?
>> focusedCommentId=14059918&page=com.atlassian.jira.
>> plugin.system.issuetabpanels:comment-tabpanel#comment-14059918
>> Garret Wilson makes a good point that the name of DisabledLinkBehavior is
>> probably a bit confusing. The name suggests that this is the recommended
>> way to disable links.
>>
>> Here are my suggestions to improve this:
>> 1) rename to Wicket6DisabledLinkBehavior + javadoc update explaining that
>> this is how links were disabled in Wicket 6
>> 2) rename to LegacyDisabledLinkBehavior + javadoc update explaining that
>> this is how links were disabled in Wicket 6
>> 3) javadoc update explaining that this is how links were disabled in
>> Wicket
>> 6
>>
>> In case of 1) or 2) we will update the migration guide too.
>>
>> Other ideas ?
>>
>> Martin Grigorov
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
>>
>>
>

Re: Rename DisabledLinkBehavior

Posted by Martin Grigorov <mg...@apache.org>.
On Jul 19, 2014 8:40 PM, "Garret Wilson" <ga...@globalmentor.com> wrote:
>
> Hi, Martin et. al! Warning---I've been stuck three days with weather and
canceled flights in different time zones, trying to leave for Brazil for my
vacation, so please excuse any grumpiness that shines through because of
this ordeal! :D
>
> Response below:
>
> On 7/19/2014 10:14 AM, Martin Grigorov wrote:
>>
>> ...
>>
>> Try to create a reusable Behavior that:
>> 1) by default does what Wicket 6.x does (i.e. <a> -> <span>, wrap in
<em>)
>> 2) optionally prevents 1)
>> 3) optionally adds a special class to the tag
>> 4) optionally adds disabled="disabled" to the tag
>> 5) optionally just removes 'href' from <a> (as per W3C recommendation)
>> 6) is open enough so that a sub-class does something custom
>>
>> It will be a big and rather complex Behavior which will try to do many
>> things and an application will use just of them.
>
>
> Ack! I completely agree! But who proposed a behavior that does all that?
I didn't!
>
>
>
>> I prefer the Unix-style: do 1 thing and do it as simple as possible. If
>> second thing is needed then create a second tool (i.e. behavior)
>>
>
> Exactly! Wicket allows behaviors to work together, right? So we needs
lots of little simple behaviors that do their job well that can be mixed
and matched as the developer desires.
>
> As I mentioned I'm tired and grumpy because of the flight. Give me a few
days (or maybe after my vacation this week) and I'll create a JIRA, create
some sub-tasks on it, and add some patches or do a pull request or
whatever, now that I have Git working. If you like what I give you, great.
If you don't, you can throw them away.
>
> Have a good weekend.

Have a nice vacation!

>
> Garret

Re: Rename DisabledLinkBehavior

Posted by Garret Wilson <ga...@globalmentor.com>.
Hi, Martin et. al! Warning---I've been stuck three days with weather and 
canceled flights in different time zones, trying to leave for Brazil for 
my vacation, so please excuse any grumpiness that shines through because 
of this ordeal! :D

Response below:

On 7/19/2014 10:14 AM, Martin Grigorov wrote:
> ...
> Try to create a reusable Behavior that:
> 1) by default does what Wicket 6.x does (i.e. <a> -> <span>, wrap in <em>)
> 2) optionally prevents 1)
> 3) optionally adds a special class to the tag
> 4) optionally adds disabled="disabled" to the tag
> 5) optionally just removes 'href' from <a> (as per W3C recommendation)
> 6) is open enough so that a sub-class does something custom
>
> It will be a big and rather complex Behavior which will try to do many
> things and an application will use just of them.

Ack! I completely agree! But who proposed a behavior that does all that? 
I didn't!


> I prefer the Unix-style: do 1 thing and do it as simple as possible. If
> second thing is needed then create a second tool (i.e. behavior)
>

Exactly! Wicket allows behaviors to work together, right? So we needs 
lots of little simple behaviors that do their job well that can be mixed 
and matched as the developer desires.

As I mentioned I'm tired and grumpy because of the flight. Give me a few 
days (or maybe after my vacation this week) and I'll create a JIRA, 
create some sub-tasks on it, and add some patches or do a pull request 
or whatever, now that I have Git working. If you like what I give you, 
great. If you don't, you can throw them away.

Have a good weekend.

Garret

Re: Rename DisabledLinkBehavior

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

On Fri, Jul 18, 2014 at 7:43 PM, Garret Wilson <ga...@globalmentor.com>
wrote:

> On 7/18/2014 3:05 AM, Sven Meier wrote:
>
>> Hi,
>>
>> 3.5) Improve the javadoc and deprecate the class too, so users know they
>> should move away from it.
>>
>
> Why should users move away from it if they like that behavior? If this
> class were generalized, it would be useful to say "have this component wrap
> itself is <foo> and </foo> when it is disabled". Wicket shouldn't force
> specialized HTML on users, but shouldn't discourage them from it, either.
>
> My philosophy is: Wicket should produce plain HTML out of the box, but
> provide the tools so that developers can easily customize the output via
> declarative behaviors, resorting to subclassing components only as a last
> resort.
>

Try to create a reusable Behavior that:
1) by default does what Wicket 6.x does (i.e. <a> -> <span>, wrap in <em>)
2) optionally prevents 1)
3) optionally adds a special class to the tag
4) optionally adds disabled="disabled" to the tag
5) optionally just removes 'href' from <a> (as per W3C recommendation)
6) is open enough so that a sub-class does something custom

It will be a big and rather complex Behavior which will try to do many
things and an application will use just of them.
I prefer the Unix-style: do 1 thing and do it as simple as possible. If
second thing is needed then create a second tool (i.e. behavior)




>
> Just my opinion---as you can see I have lots of them. :) I hope you find
> some of them helpful.
>
> Cheers,
>
> Garret
>

Re: Rename DisabledLinkBehavior

Posted by Sven Meier <sv...@meiers.net>.
Hi Garret,

 >Wicket should produce plain HTML out of the box

Agreed.

 >...but provide the tools so that developers can easily customize the 
output

 From my experience it is very hard to find solutions that match the 
expectations of all users and developers: Wicket enables applications to 
build their own solution, but it doesn't have to contain every 
imaginable convenience class.

We provide DisabledLinkBehavior for applications which depend exactly on 
the old tag-mangling before WIcket 7.x. We all agreed, that nowadays 
disabled links represented via other means.
If the class is declared as deprecated, developers have time to think of 
their own solution until Wicket 8.x comes out.

Best regards
Sven



On 07/18/2014 06:43 PM, Garret Wilson wrote:
> On 7/18/2014 3:05 AM, Sven Meier wrote:
>> Hi,
>>
>> 3.5) Improve the javadoc and deprecate the class too, so users know 
>> they should move away from it.
>
> Why should users move away from it if they like that behavior? If this 
> class were generalized, it would be useful to say "have this component 
> wrap itself is <foo> and </foo> when it is disabled". Wicket shouldn't 
> force specialized HTML on users, but shouldn't discourage them from 
> it, either.
>
> My philosophy is: Wicket should produce plain HTML out of the box, but 
> provide the tools so that developers can easily customize the output 
> via declarative behaviors, resorting to subclassing components only as 
> a last resort.
>
> Just my opinion---as you can see I have lots of them. :) I hope you 
> find some of them helpful.
>
> Cheers,
>
> Garret


Re: Rename DisabledLinkBehavior

Posted by Garret Wilson <ga...@globalmentor.com>.
On 7/18/2014 3:05 AM, Sven Meier wrote:
> Hi,
>
> 3.5) Improve the javadoc and deprecate the class too, so users know 
> they should move away from it.

Why should users move away from it if they like that behavior? If this 
class were generalized, it would be useful to say "have this component 
wrap itself is <foo> and </foo> when it is disabled". Wicket shouldn't 
force specialized HTML on users, but shouldn't discourage them from it, 
either.

My philosophy is: Wicket should produce plain HTML out of the box, but 
provide the tools so that developers can easily customize the output via 
declarative behaviors, resorting to subclassing components only as a 
last resort.

Just my opinion---as you can see I have lots of them. :) I hope you find 
some of them helpful.

Cheers,

Garret

Re: Rename DisabledLinkBehavior

Posted by Sven Meier <sv...@meiers.net>.
Hi,

3.5) Improve the javadoc and deprecate the class too, so users know they 
should move away from it.

My 2 cents
Sven


On 07/18/2014 09:39 AM, Martin Grigorov wrote:
> Hi,
>
> At
> https://issues.apache.org/jira/browse/WICKET-4904?focusedCommentId=14059918&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14059918
> Garret Wilson makes a good point that the name of DisabledLinkBehavior is
> probably a bit confusing. The name suggests that this is the recommended
> way to disable links.
>
> Here are my suggestions to improve this:
> 1) rename to Wicket6DisabledLinkBehavior + javadoc update explaining that
> this is how links were disabled in Wicket 6
> 2) rename to LegacyDisabledLinkBehavior + javadoc update explaining that
> this is how links were disabled in Wicket 6
> 3) javadoc update explaining that this is how links were disabled in Wicket
> 6
>
> In case of 1) or 2) we will update the migration guide too.
>
> Other ideas ?
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>