You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Al Maw <wi...@almaw.com> on 2007/06/18 06:37:27 UTC

Fix inconsistent naming for submit components

Hello,

I know we're in a feature freeze, and I'm aware this one is likely to be 
somewhat controversial, but I think we should rename a couple of the 
submit components, leaving behind @deprecated classes which extend the 
renamed ones.

We currently have:

Button, ImageButton, SubmitLink, AjaxSubmitButton, AjaxSubmitLink.

We're about to have an AjaxFallbackSubmitButton, too. [1]

It would make sense for me for everything to be based on the word 
"Submit", so I think we should rename:

        Button -> SubmitButton (highly controversial, obviously)
   ImageButton -> SubmitImage

This may well need to wait 'til 1.4.x.

WDYT?


Al

-- 
Alastair Maw
Wicket-biased blog at http://herebebeasties.com

[1] WICKET-634
     [Ajax[Fallback]]Submit[Image|Button|Link]
     If we support all combinations (which we probably should) that's
     nine(!) components. I wish Java supported mix-ins. :-(

Re: Fix inconsistent naming for submit components

Posted by Al Maw <wi...@almaw.com>.
Eelco Hillenius wrote:
>> -1 on the streamline. I'm not going to go through and rewrite my
>> chapters of the book yet *again*.
>>
>> Can we just agree to keep the API stable?
> 
> Yeah, +1 on that. You guys scare the hell out of me if I have to think
> about how long *any* book will be valueable on any version :-) It's
> time to settle down on our core components/ concepts for a while. It
> will never be perfect/ to everyone's taste, and there's enough other
> things that imho would have more priority.

I think the best thing would be:

  - Rename AjaxSubmitButton to AjaxButton.
  - Keep a subclass impl (@deprecated) to provide backwards-compat.

That's it. Anyone deeply object to that?

Al
-- 
Alastair Maw
Wicket-biased blog at http://herebebeasties.com

Re: Fix inconsistent naming for submit components

Posted by Eelco Hillenius <ee...@gmail.com>.
> -1 on the streamline. I'm not going to go through and rewrite my
> chapters of the book yet *again*.
>
> Can we just agree to keep the API stable?

Yeah, +1 on that. You guys scare the hell out of me if I have to think
about how long *any* book will be valueable on any version :-) It's
time to settle down on our core components/ concepts for a while. It
will never be perfect/ to everyone's taste, and there's enough other
things that imho would have more priority.

Eelco

Re: Fix inconsistent naming for submit components

Posted by Martijn Dashorst <ma...@gmail.com>.
-1 on the streamline. I'm not going to go through and rewrite my
chapters of the book yet *again*.

Can we just agree to keep the API stable?

Martijn

On 6/18/07, Johan Compagner <jc...@gmail.com> wrote:
> because wicket is so flexible that you can do almost everything with just
> one component!
>
> for the html below i would use button.. But that is because it is visual a
> button.
>
> The differences are i guess that button has the submit() method and link the
> onClick()
> and because of those silly behaviours we have suddenly a Button can also
> 'have' an onclick.
> and Link could be a form submitting component when it implements the
> interface....
>
> So how to streamline all this? i don't know
> lets just make Button and Link pretty much behave the same.
>
> johan
>
> On 6/18/07, Igor Vaynberg <ig...@gmail.com> wrote:
> >
> > since everyone is talking about this can i add some more flames? why is
> > Link
> > called link? cause really its not just a link.
> >
> > you can do:
> > add(new Link("foo") {});
> >
> > and in markup have
> >
> > <a wicket:id="foo"></a>
> > <input type="button" wicket:id="foo"/>
> > <button wicket:id="foo"/>
> >
> > so its not just a link.
> >
> > -igor
> >
> >
> > On 6/18/07, Johan Compagner <jc...@gmail.com> wrote:
> > >
> > > i agree more with Frank,
> > >
> > > i don't like that Button would be come SubmitButton
> > >
> > > For me Button doesn't say what it does. no it tells me how it looks
> > > And many buttons don't submit but they are link (onclick)
> > >
> > > So having a SubmitButton is mostly not true for me because it doesn't so
> > a
> > > submit!
> > > its a <button type="button" onclick="">
> > >
> > > johan
> > >
> > >
> > > On 6/18/07, Frank Bille <fr...@gmail.com> wrote:
> > > >
> > > > Hey
> > > >
> > > > We could also rename AjaxSubmitButton into AjaxButton.
> > > >
> > > > Then we have:
> > > > Button, ImageButton and AjaxButton (and AjaxFallbackButton)
> > > >
> > > > and
> > > >
> > > > SubmitLink and AjaxSubmitLink
> > > >
> > > > I don't know whats best, yet. It's just a surgestion now that we play
> > > with
> > > > names :)
> > > >
> > > > Frank
> > > >
> > > >
> > > > On 6/18/07, Al Maw <wi...@almaw.com> wrote:
> > > > >
> > > > > Hello,
> > > > >
> > > > > I know we're in a feature freeze, and I'm aware this one is likely
> > to
> > > be
> > > > > somewhat controversial, but I think we should rename a couple of the
> > > > > submit components, leaving behind @deprecated classes which extend
> > the
> > > > > renamed ones.
> > > > >
> > > > > We currently have:
> > > > >
> > > > > Button, ImageButton, SubmitLink, AjaxSubmitButton, AjaxSubmitLink.
> > > > >
> > > > > We're about to have an AjaxFallbackSubmitButton, too. [1]
> > > > >
> > > > > It would make sense for me for everything to be based on the word
> > > > > "Submit", so I think we should rename:
> > > > >
> > > > >         Button -> SubmitButton (highly controversial, obviously)
> > > > >    ImageButton -> SubmitImage
> > > > >
> > > > > This may well need to wait 'til 1.4.x.
> > > > >
> > > > > WDYT?
> > > > >
> > > > >
> > > > > Al
> > > > >
> > > > > --
> > > > > Alastair Maw
> > > > > Wicket-biased blog at http://herebebeasties.com
> > > > >
> > > > > [1] WICKET-634
> > > > >      [Ajax[Fallback]]Submit[Image|Button|Link]
> > > > >      If we support all combinations (which we probably should)
> > that's
> > > > >      nine(!) components. I wish Java supported mix-ins. :-(
> > > > >
> > > >
> > >
> >
>


-- 
Join the wicket community at irc.freenode.net: ##wicket
Wicket 1.2.6 contains a very important fix. Download Wicket now!
http://wicketframework.org

Re: Fix inconsistent naming for submit components

Posted by Johan Compagner <jc...@gmail.com>.
because wicket is so flexible that you can do almost everything with just
one component!

for the html below i would use button.. But that is because it is visual a
button.

The differences are i guess that button has the submit() method and link the
onClick()
and because of those silly behaviours we have suddenly a Button can also
'have' an onclick.
and Link could be a form submitting component when it implements the
interface....

So how to streamline all this? i don't know
lets just make Button and Link pretty much behave the same.

johan

On 6/18/07, Igor Vaynberg <ig...@gmail.com> wrote:
>
> since everyone is talking about this can i add some more flames? why is
> Link
> called link? cause really its not just a link.
>
> you can do:
> add(new Link("foo") {});
>
> and in markup have
>
> <a wicket:id="foo"></a>
> <input type="button" wicket:id="foo"/>
> <button wicket:id="foo"/>
>
> so its not just a link.
>
> -igor
>
>
> On 6/18/07, Johan Compagner <jc...@gmail.com> wrote:
> >
> > i agree more with Frank,
> >
> > i don't like that Button would be come SubmitButton
> >
> > For me Button doesn't say what it does. no it tells me how it looks
> > And many buttons don't submit but they are link (onclick)
> >
> > So having a SubmitButton is mostly not true for me because it doesn't so
> a
> > submit!
> > its a <button type="button" onclick="">
> >
> > johan
> >
> >
> > On 6/18/07, Frank Bille <fr...@gmail.com> wrote:
> > >
> > > Hey
> > >
> > > We could also rename AjaxSubmitButton into AjaxButton.
> > >
> > > Then we have:
> > > Button, ImageButton and AjaxButton (and AjaxFallbackButton)
> > >
> > > and
> > >
> > > SubmitLink and AjaxSubmitLink
> > >
> > > I don't know whats best, yet. It's just a surgestion now that we play
> > with
> > > names :)
> > >
> > > Frank
> > >
> > >
> > > On 6/18/07, Al Maw <wi...@almaw.com> wrote:
> > > >
> > > > Hello,
> > > >
> > > > I know we're in a feature freeze, and I'm aware this one is likely
> to
> > be
> > > > somewhat controversial, but I think we should rename a couple of the
> > > > submit components, leaving behind @deprecated classes which extend
> the
> > > > renamed ones.
> > > >
> > > > We currently have:
> > > >
> > > > Button, ImageButton, SubmitLink, AjaxSubmitButton, AjaxSubmitLink.
> > > >
> > > > We're about to have an AjaxFallbackSubmitButton, too. [1]
> > > >
> > > > It would make sense for me for everything to be based on the word
> > > > "Submit", so I think we should rename:
> > > >
> > > >         Button -> SubmitButton (highly controversial, obviously)
> > > >    ImageButton -> SubmitImage
> > > >
> > > > This may well need to wait 'til 1.4.x.
> > > >
> > > > WDYT?
> > > >
> > > >
> > > > Al
> > > >
> > > > --
> > > > Alastair Maw
> > > > Wicket-biased blog at http://herebebeasties.com
> > > >
> > > > [1] WICKET-634
> > > >      [Ajax[Fallback]]Submit[Image|Button|Link]
> > > >      If we support all combinations (which we probably should)
> that's
> > > >      nine(!) components. I wish Java supported mix-ins. :-(
> > > >
> > >
> >
>

Re: Fix inconsistent naming for submit components

Posted by Igor Vaynberg <ig...@gmail.com>.
since everyone is talking about this can i add some more flames? why is Link
called link? cause really its not just a link.

you can do:
add(new Link("foo") {});

and in markup have

<a wicket:id="foo"></a>
<input type="button" wicket:id="foo"/>
<button wicket:id="foo"/>

so its not just a link.

-igor


On 6/18/07, Johan Compagner <jc...@gmail.com> wrote:
>
> i agree more with Frank,
>
> i don't like that Button would be come SubmitButton
>
> For me Button doesn't say what it does. no it tells me how it looks
> And many buttons don't submit but they are link (onclick)
>
> So having a SubmitButton is mostly not true for me because it doesn't so a
> submit!
> its a <button type="button" onclick="">
>
> johan
>
>
> On 6/18/07, Frank Bille <fr...@gmail.com> wrote:
> >
> > Hey
> >
> > We could also rename AjaxSubmitButton into AjaxButton.
> >
> > Then we have:
> > Button, ImageButton and AjaxButton (and AjaxFallbackButton)
> >
> > and
> >
> > SubmitLink and AjaxSubmitLink
> >
> > I don't know whats best, yet. It's just a surgestion now that we play
> with
> > names :)
> >
> > Frank
> >
> >
> > On 6/18/07, Al Maw <wi...@almaw.com> wrote:
> > >
> > > Hello,
> > >
> > > I know we're in a feature freeze, and I'm aware this one is likely to
> be
> > > somewhat controversial, but I think we should rename a couple of the
> > > submit components, leaving behind @deprecated classes which extend the
> > > renamed ones.
> > >
> > > We currently have:
> > >
> > > Button, ImageButton, SubmitLink, AjaxSubmitButton, AjaxSubmitLink.
> > >
> > > We're about to have an AjaxFallbackSubmitButton, too. [1]
> > >
> > > It would make sense for me for everything to be based on the word
> > > "Submit", so I think we should rename:
> > >
> > >         Button -> SubmitButton (highly controversial, obviously)
> > >    ImageButton -> SubmitImage
> > >
> > > This may well need to wait 'til 1.4.x.
> > >
> > > WDYT?
> > >
> > >
> > > Al
> > >
> > > --
> > > Alastair Maw
> > > Wicket-biased blog at http://herebebeasties.com
> > >
> > > [1] WICKET-634
> > >      [Ajax[Fallback]]Submit[Image|Button|Link]
> > >      If we support all combinations (which we probably should) that's
> > >      nine(!) components. I wish Java supported mix-ins. :-(
> > >
> >
>

Re: Fix inconsistent naming for submit components

Posted by Johan Compagner <jc...@gmail.com>.
i agree more with Frank,

i don't like that Button would be come SubmitButton

For me Button doesn't say what it does. no it tells me how it looks
And many buttons don't submit but they are link (onclick)

So having a SubmitButton is mostly not true for me because it doesn't so a
submit!
its a <button type="button" onclick="">

johan


On 6/18/07, Frank Bille <fr...@gmail.com> wrote:
>
> Hey
>
> We could also rename AjaxSubmitButton into AjaxButton.
>
> Then we have:
> Button, ImageButton and AjaxButton (and AjaxFallbackButton)
>
> and
>
> SubmitLink and AjaxSubmitLink
>
> I don't know whats best, yet. It's just a surgestion now that we play with
> names :)
>
> Frank
>
>
> On 6/18/07, Al Maw <wi...@almaw.com> wrote:
> >
> > Hello,
> >
> > I know we're in a feature freeze, and I'm aware this one is likely to be
> > somewhat controversial, but I think we should rename a couple of the
> > submit components, leaving behind @deprecated classes which extend the
> > renamed ones.
> >
> > We currently have:
> >
> > Button, ImageButton, SubmitLink, AjaxSubmitButton, AjaxSubmitLink.
> >
> > We're about to have an AjaxFallbackSubmitButton, too. [1]
> >
> > It would make sense for me for everything to be based on the word
> > "Submit", so I think we should rename:
> >
> >         Button -> SubmitButton (highly controversial, obviously)
> >    ImageButton -> SubmitImage
> >
> > This may well need to wait 'til 1.4.x.
> >
> > WDYT?
> >
> >
> > Al
> >
> > --
> > Alastair Maw
> > Wicket-biased blog at http://herebebeasties.com
> >
> > [1] WICKET-634
> >      [Ajax[Fallback]]Submit[Image|Button|Link]
> >      If we support all combinations (which we probably should) that's
> >      nine(!) components. I wish Java supported mix-ins. :-(
> >
>

Re: Fix inconsistent naming for submit components

Posted by Frank Bille <fr...@gmail.com>.
On 6/18/07, Al Maw <wi...@almaw.com> wrote:
>
> Frank Bille wrote:
> > Hey
> >
> > We could also rename AjaxSubmitButton into AjaxButton.
> >
> > Then we have:
> > Button, ImageButton and AjaxButton (and AjaxFallbackButton)
> >
> > and
> >
> > SubmitLink and AjaxSubmitLink
>
> Hmmm, that would be LinkButton and AjaxLinkButton, surely? :-)


My thought was that button indicates submit anyway, so it was only for links
that you had to be specific about that it would submit.


[Ajax[Fallback]]Submit[Foo] is the only thing that makes sense to me
> across the board.
>

tbh, I don't really have a string oppionion on this. In my eyes it's only
AjaxSubmitButton that stands out. But I can also follow the idea behind your
naming scheme.

Frank

Re: Fix inconsistent naming for submit components

Posted by Al Maw <wi...@almaw.com>.
Frank Bille wrote:
> Hey
> 
> We could also rename AjaxSubmitButton into AjaxButton.
> 
> Then we have:
> Button, ImageButton and AjaxButton (and AjaxFallbackButton)
> 
> and
> 
> SubmitLink and AjaxSubmitLink

Hmmm, that would be LinkButton and AjaxLinkButton, surely? :-)

[Ajax[Fallback]]Submit[Foo] is the only thing that makes sense to me 
across the board.

Al

-- 
Alastair Maw
Wicket-biased blog at http://herebebeasties.com

Re: Fix inconsistent naming for submit components

Posted by Frank Bille <fr...@gmail.com>.
Hey

We could also rename AjaxSubmitButton into AjaxButton.

Then we have:
Button, ImageButton and AjaxButton (and AjaxFallbackButton)

and

SubmitLink and AjaxSubmitLink

I don't know whats best, yet. It's just a surgestion now that we play with
names :)

Frank


On 6/18/07, Al Maw <wi...@almaw.com> wrote:
>
> Hello,
>
> I know we're in a feature freeze, and I'm aware this one is likely to be
> somewhat controversial, but I think we should rename a couple of the
> submit components, leaving behind @deprecated classes which extend the
> renamed ones.
>
> We currently have:
>
> Button, ImageButton, SubmitLink, AjaxSubmitButton, AjaxSubmitLink.
>
> We're about to have an AjaxFallbackSubmitButton, too. [1]
>
> It would make sense for me for everything to be based on the word
> "Submit", so I think we should rename:
>
>         Button -> SubmitButton (highly controversial, obviously)
>    ImageButton -> SubmitImage
>
> This may well need to wait 'til 1.4.x.
>
> WDYT?
>
>
> Al
>
> --
> Alastair Maw
> Wicket-biased blog at http://herebebeasties.com
>
> [1] WICKET-634
>      [Ajax[Fallback]]Submit[Image|Button|Link]
>      If we support all combinations (which we probably should) that's
>      nine(!) components. I wish Java supported mix-ins. :-(
>

Re: Fix inconsistent naming for submit components

Posted by Al Maw <wi...@almaw.com>.
Eelco Hillenius wrote:
> I've given this thread a little bit thought, and besides the
> objections Martijn and me have regarding the book, I don't think I
> like SubmitButton better than Button. To me, a Button is more generic
> and SubmitButton makes me think about 'just' the <input type="submit">
> tag while it can be used for more than that (which is something I
> always liked). Just a personal preference, sure, but also an
> indication to me that we might like SubmitButton today, Button
> tomorrow, and they day after (maybe with other people in the team)
> SubmitButton again. At some point we'll just have to say, this is ok,
> even if not everyone completely agrees at any given time. Naming is
> important, but so is stability.

Yeah, I agree. ;-)

The real issue here is with predictability and consistency. I expect the 
AJAX version of component Foo to be called AjaxFoo, and with the button 
stuff, it wasn't.

So either we change AjaxSubmitButton to be AjaxButton, or change Button 
to be SubmitButton, otherwise it's just really confusing.

Button is definitely used more heavily than AjaxSubmitButton, so the 
former change has the least impact, which is why I've just implemented it.

The only argument for SubmitButton is that it's consistent with 
SubmitLink. That said, you can always argue SubmitLink is oddly named, 
as there's really no such thing in the HTML spec, and it should be 
called JavascriptSubmitLink instead. ;-)

Swings. Roundabouts.

I think we're done with this now...

Al

-- 
Alastair Maw
Wicket-biased blog at http://herebebeasties.com

Re: Fix inconsistent naming for submit components

Posted by Eelco Hillenius <ee...@gmail.com>.
I've given this thread a little bit thought, and besides the
objections Martijn and me have regarding the book, I don't think I
like SubmitButton better than Button. To me, a Button is more generic
and SubmitButton makes me think about 'just' the <input type="submit">
tag while it can be used for more than that (which is something I
always liked). Just a personal preference, sure, but also an
indication to me that we might like SubmitButton today, Button
tomorrow, and they day after (maybe with other people in the team)
SubmitButton again. At some point we'll just have to say, this is ok,
even if not everyone completely agrees at any given time. Naming is
important, but so is stability.

My 2c,

Eelco

Re: Fix inconsistent naming for submit components

Posted by Timo Rantalaiho <Ti...@ri.fi>.
On Mon, 18 Jun 2007, Al Maw wrote:
> It would make sense for me for everything to be based on the word 
> "Submit", so I think we should rename:

Anyway there is IFormSubmittingComponent that is implemented 
by all of those, so I don't think there is a big problem. 

A type is always better than a magic value (even in a name,
though names are important).

- Timo

-- 
Timo Rantalaiho           
Reaktor Innovations Oy    <URL: http://www.ri.fi/ >