You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Johan Compagner <jc...@gmail.com> on 2010/07/26 11:21:48 UTC

Re: IVisitor and IFormModelUpdateListener not extending Component

you can use:

	public final <S extends Component> Object visitChildren(final Class<?> clazz,
		final IVisitor<S> visitor)


then you have to cast yes, but you can cast safely.

johan


On Mon, Jul 26, 2010 at 11:09, Joseph Pachod <jp...@thomas-daily.de> wrote:
> hello
>
> I wanted to do an Component.IVisitor for all children components
> implementing IFormModelUpdateListener.
>
> However, IVisitor requires something extending Component, which
> IFormModelUpdateListener can't do (it's an interface).
>
> As such, I had to dump all generics info and do instanceof to get it
> running.
>
> However, for wicket 1.5 I guess, shouldn't there be an IComponent interface
> that IFormModelUpdateListener would implement ? IVisitor would then be of <T
> extends IComponent> and I could do an IVisitor<IFormModelUpdateListener>.
>
> What's your pick on that ?
>
> ++
>
> --
> Joseph Pachod
> IT
>
> THOMAS DAILY GmbH
> Adlerstraße 19
> 79098 Freiburg
> Deutschland
> T  + 49 761 3 85 59 506
> F  + 49 761 3 85 59 550
> E  joseph.pachod@thomas-daily.de
> www.thomas-daily.de
>
> Geschäftsführer/Managing Directors:
> Wendy Thomas, Susanne Larbig
> Handelsregister Freiburg i.Br., HRB 3947
>
> Registrieren Sie sich unter https://www.thomas-daily.de/user/sign-in für die
> TD Morning News, eine kostenlose Auswahl aktueller Themen aus TD Premium,
> morgens ab 9:15 in Ihrer Mailbox.
>
> Aktuelle Presseinformationen für die TD Morning News und TD Premium nimmt
> unsere Redaktion unter redaktion@thomas-daily.de entgegen.
> Redaktionsschluss für die TD Morning News ist täglich um 8:45.
>
> Register free of charge at https://www.thomas-daily.de/user/sign-in to have
> the TD Morning News, a selection of the latest topics from TD Premium,
> delivered to your mailbox from 9:15 every morning.
>
> Our editorial department receives the latest press releases for the TD
> Morning News and TD Premium at redaktion@thomas-daily.de. The editorial
> deadline for the TD Morning News is 8.45am daily.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: IVisitor and IFormModelUpdateListener not extending Component

Posted by Igor Vaynberg <ig...@gmail.com>.
no, irequestablecomponent is only a micro-part of what component is
and will not help in this usecase

-igor

On Wed, Jul 28, 2010 at 6:41 AM, Martin Grigorov <mg...@apache.org> wrote:
> In 1.5.x (trunk) there
> is org.apache.wicket.request.component.IRequestableComponent
> It is implemented by :
> - org.apache.wicket.request.component.IRequestableComponent
> - org.apache.wicket.request.component.IRequestablePage
> - org.apache.wicket.MockComponent
>
> Not sure whether it fits the requested enhancement
> for IFormModelUpdateListener
>
>
> On Wed, Jul 28, 2010 at 3:35 PM, Johan Compagner <jc...@gmail.com>wrote:
>
>> having IComponent for me means that there are more then 1 Component..
>> (there are multiply implementations possible then)
>> So then we have to use IComponent everwhere instead of Component
>> That means again that it will be a quite large interface, and do we
>> also then get IMarkupContainer? (and so on and so on)
>>
>> Why isnt there a javax.swing.IJComponent ?
>>
>> If this is really a problem then why not drop the  "extends Component"
>> from the
>> public final <S extends Component> Object visitChildren
>> and
>> public static interface IVisitor<T extends Component>
>>
>> Then you can give anything you want to it.
>>
>> Problem is that you then have less type checking there. Because that
>> would make IVisitor completely "generic"
>>
>>
>>
>> On Wed, Jul 28, 2010 at 15:27, Joseph Pachod <jp...@thomas-daily.de> wrote:
>> > Johan Compagner wrote:
>> >>
>> >> you can use:
>> >>
>> >>        public final <S extends Component> Object visitChildren(final
>> >> Class<?> clazz,
>> >>                final IVisitor<S> visitor)
>> >>
>> >>
>> >> then you have to cast yes, but you can cast safely.
>> >>
>> >
>> > Hi
>> >
>> > Yet, why not having an IComponent interface that IFormModelUpdateListener
>> > (and lot of other I guess) would extend ?
>> >
>> > And in fact it's quite the same for FormComponent. It would be handy to
>> have
>> > an IFormComponent which could be used there and there.
>> >
>> > For example in the ListEditor's igor did, which really is a FormComponent
>> > but has to extend Repeater.
>> >
>> > ++
>> >
>> > --
>> > Joseph Pachod
>> > IT
>> >
>> > THOMAS DAILY GmbH
>> > Adlerstraße 19
>> > 79098 Freiburg
>> > Deutschland
>> > T  + 49 761 3 85 59 506
>> > F  + 49 761 3 85 59 550
>> > E  joseph.pachod@thomas-daily.de
>> > www.thomas-daily.de
>> >
>> > Geschäftsführer/Managing Directors:
>> > Wendy Thomas, Susanne Larbig
>> > Handelsregister Freiburg i.Br., HRB 3947
>> >
>> > Registrieren Sie sich unter https://www.thomas-daily.de/user/sign-in für
>> die
>> > TD Morning News, eine kostenlose Auswahl aktueller Themen aus TD Premium,
>> > morgens ab 9:15 in Ihrer Mailbox.
>> >
>> > Aktuelle Presseinformationen für die TD Morning News und TD Premium nimmt
>> > unsere Redaktion unter redaktion@thomas-daily.de entgegen.
>> > Redaktionsschluss für die TD Morning News ist täglich um 8:45.
>> >
>> > Register free of charge at https://www.thomas-daily.de/user/sign-in to
>> have
>> > the TD Morning News, a selection of the latest topics from TD Premium,
>> > delivered to your mailbox from 9:15 every morning.
>> >
>> > Our editorial department receives the latest press releases for the TD
>> > Morning News and TD Premium at redaktion@thomas-daily.de. The editorial
>> > deadline for the TD Morning News is 8.45am daily.
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > For additional commands, e-mail: users-help@wicket.apache.org
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: IVisitor and IFormModelUpdateListener not extending Component

Posted by Martin Grigorov <mg...@apache.org>.
In 1.5.x (trunk) there
is org.apache.wicket.request.component.IRequestableComponent
It is implemented by :
- org.apache.wicket.request.component.IRequestableComponent
- org.apache.wicket.request.component.IRequestablePage
- org.apache.wicket.MockComponent

Not sure whether it fits the requested enhancement
for IFormModelUpdateListener


On Wed, Jul 28, 2010 at 3:35 PM, Johan Compagner <jc...@gmail.com>wrote:

> having IComponent for me means that there are more then 1 Component..
> (there are multiply implementations possible then)
> So then we have to use IComponent everwhere instead of Component
> That means again that it will be a quite large interface, and do we
> also then get IMarkupContainer? (and so on and so on)
>
> Why isnt there a javax.swing.IJComponent ?
>
> If this is really a problem then why not drop the  "extends Component"
> from the
> public final <S extends Component> Object visitChildren
> and
> public static interface IVisitor<T extends Component>
>
> Then you can give anything you want to it.
>
> Problem is that you then have less type checking there. Because that
> would make IVisitor completely "generic"
>
>
>
> On Wed, Jul 28, 2010 at 15:27, Joseph Pachod <jp...@thomas-daily.de> wrote:
> > Johan Compagner wrote:
> >>
> >> you can use:
> >>
> >>        public final <S extends Component> Object visitChildren(final
> >> Class<?> clazz,
> >>                final IVisitor<S> visitor)
> >>
> >>
> >> then you have to cast yes, but you can cast safely.
> >>
> >
> > Hi
> >
> > Yet, why not having an IComponent interface that IFormModelUpdateListener
> > (and lot of other I guess) would extend ?
> >
> > And in fact it's quite the same for FormComponent. It would be handy to
> have
> > an IFormComponent which could be used there and there.
> >
> > For example in the ListEditor's igor did, which really is a FormComponent
> > but has to extend Repeater.
> >
> > ++
> >
> > --
> > Joseph Pachod
> > IT
> >
> > THOMAS DAILY GmbH
> > Adlerstraße 19
> > 79098 Freiburg
> > Deutschland
> > T  + 49 761 3 85 59 506
> > F  + 49 761 3 85 59 550
> > E  joseph.pachod@thomas-daily.de
> > www.thomas-daily.de
> >
> > Geschäftsführer/Managing Directors:
> > Wendy Thomas, Susanne Larbig
> > Handelsregister Freiburg i.Br., HRB 3947
> >
> > Registrieren Sie sich unter https://www.thomas-daily.de/user/sign-in für
> die
> > TD Morning News, eine kostenlose Auswahl aktueller Themen aus TD Premium,
> > morgens ab 9:15 in Ihrer Mailbox.
> >
> > Aktuelle Presseinformationen für die TD Morning News und TD Premium nimmt
> > unsere Redaktion unter redaktion@thomas-daily.de entgegen.
> > Redaktionsschluss für die TD Morning News ist täglich um 8:45.
> >
> > Register free of charge at https://www.thomas-daily.de/user/sign-in to
> have
> > the TD Morning News, a selection of the latest topics from TD Premium,
> > delivered to your mailbox from 9:15 every morning.
> >
> > Our editorial department receives the latest press releases for the TD
> > Morning News and TD Premium at redaktion@thomas-daily.de. The editorial
> > deadline for the TD Morning News is 8.45am daily.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: IVisitor and IFormModelUpdateListener not extending Component

Posted by Igor Vaynberg <ig...@gmail.com>.
On Wed, Jul 28, 2010 at 8:14 AM, Joseph Pachod <jp...@thomas-daily.de> wrote:

> On the other hand, some
> methods could be grouped on distinct interfaces, like the ones about
> feedback messages.

that was the idea for a while. build up all the tiny interfaces and
IComponent would mostly extend a bunch of them rather then directly
specifying methods. however, no one has had time to implement the
change and see if it would work because it would involve a tremendous
amount of time.

-igor


>
> Overall, I feel like it would be quite some work to do but that it would pay
> off. Many interface/component could be even more open for customization and
> the like, given ever more options to the developers.
>
> Yet it doesn't look utter crazy neither, so the overall return on investment
> is unclear. Furthermore, you and other wicket core committers obviously know
> better, so, no issue if this idea is dropped.
>
> ++
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: IVisitor and IFormModelUpdateListener not extending Component

Posted by Joseph Pachod <jp...@thomas-daily.de>.
Johan Compagner wrote:
> having IComponent for me means that there are more then 1 Component..
> (there are multiply implementations possible then)
> So then we have to use IComponent everwhere instead of Component
> That means again that it will be a quite large interface, and do we
> also then get IMarkupContainer? (and so on and so on)
>
> Why isnt there a javax.swing.IJComponent ?
>
> If this is really a problem then why not drop the  "extends Component"
> from the
> public final <S extends Component> Object visitChildren
> and
> public static interface IVisitor<T extends Component>
>
> Then you can give anything you want to it.
>
> Problem is that you then have less type checking there. Because that
> would make IVisitor completely "generic"
>   
Sure, one has to go for the right level of abstraction

I hit this IFormModelUpdateListener not being a component issue at 
almost the same time as I was needing the ListEditor (the one from igor 
=> cf http://bit.ly/aSY3zl) to be a FormComponent, which is a pain to do 
because of ListEditor extending RepeatingView.

As such, having this 2 notions through some interfaces would have 
resolved by 2 issues of the time, hence this mail ;)

On top of that, IFormModelUpdateListener applies only to Component, but 
currently could be applied anywhere. Once again an interface looked like 
a good solution to tackle that.

For the MarkupContainer question (and the bigger picture), well, indeed 
it looks like the logical way to go would be to mimic the current "core" 
elements of wicket's components hierarchy with interfaces.

But then, the "worst" interface would be the one for Component, which 
based on the 1.5 Component class would at least have 103 methods (I 
took  the public ones from Component not being already part of some 
interface). MarkupContainer, on top of that and with the same rough 
methodology, would "only" add 22 methods. For sure, other methods, used 
internally, would have to be put as well in some interfaces I guess. On 
the other hand, some methods could be grouped on distinct interfaces, 
like the ones about feedback messages.

Overall, I feel like it would be quite some work to do but that it would 
pay off. Many interface/component could be even more open for 
customization and the like, given ever more options to the developers.

Yet it doesn't look utter crazy neither, so the overall return on 
investment is unclear. Furthermore, you and other wicket core committers 
obviously know better, so, no issue if this idea is dropped.

++


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: IVisitor and IFormModelUpdateListener not extending Component

Posted by Johan Compagner <jc...@gmail.com>.
having IComponent for me means that there are more then 1 Component..
(there are multiply implementations possible then)
So then we have to use IComponent everwhere instead of Component
That means again that it will be a quite large interface, and do we
also then get IMarkupContainer? (and so on and so on)

Why isnt there a javax.swing.IJComponent ?

If this is really a problem then why not drop the  "extends Component"
from the
public final <S extends Component> Object visitChildren
and
public static interface IVisitor<T extends Component>

Then you can give anything you want to it.

Problem is that you then have less type checking there. Because that
would make IVisitor completely "generic"



On Wed, Jul 28, 2010 at 15:27, Joseph Pachod <jp...@thomas-daily.de> wrote:
> Johan Compagner wrote:
>>
>> you can use:
>>
>>        public final <S extends Component> Object visitChildren(final
>> Class<?> clazz,
>>                final IVisitor<S> visitor)
>>
>>
>> then you have to cast yes, but you can cast safely.
>>
>
> Hi
>
> Yet, why not having an IComponent interface that IFormModelUpdateListener
> (and lot of other I guess) would extend ?
>
> And in fact it's quite the same for FormComponent. It would be handy to have
> an IFormComponent which could be used there and there.
>
> For example in the ListEditor's igor did, which really is a FormComponent
> but has to extend Repeater.
>
> ++
>
> --
> Joseph Pachod
> IT
>
> THOMAS DAILY GmbH
> Adlerstraße 19
> 79098 Freiburg
> Deutschland
> T  + 49 761 3 85 59 506
> F  + 49 761 3 85 59 550
> E  joseph.pachod@thomas-daily.de
> www.thomas-daily.de
>
> Geschäftsführer/Managing Directors:
> Wendy Thomas, Susanne Larbig
> Handelsregister Freiburg i.Br., HRB 3947
>
> Registrieren Sie sich unter https://www.thomas-daily.de/user/sign-in für die
> TD Morning News, eine kostenlose Auswahl aktueller Themen aus TD Premium,
> morgens ab 9:15 in Ihrer Mailbox.
>
> Aktuelle Presseinformationen für die TD Morning News und TD Premium nimmt
> unsere Redaktion unter redaktion@thomas-daily.de entgegen.
> Redaktionsschluss für die TD Morning News ist täglich um 8:45.
>
> Register free of charge at https://www.thomas-daily.de/user/sign-in to have
> the TD Morning News, a selection of the latest topics from TD Premium,
> delivered to your mailbox from 9:15 every morning.
>
> Our editorial department receives the latest press releases for the TD
> Morning News and TD Premium at redaktion@thomas-daily.de. The editorial
> deadline for the TD Morning News is 8.45am daily.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: IVisitor and IFormModelUpdateListener not extending Component

Posted by Joseph Pachod <jp...@thomas-daily.de>.
Johan Compagner wrote:
> you can use:
>
> 	public final <S extends Component> Object visitChildren(final Class<?> clazz,
> 		final IVisitor<S> visitor)
>
>
> then you have to cast yes, but you can cast safely.
>   
Hi

Yet, why not having an IComponent interface that 
IFormModelUpdateListener (and lot of other I guess) would extend ?

And in fact it's quite the same for FormComponent. It would be handy to 
have an IFormComponent which could be used there and there.

For example in the ListEditor's igor did, which really is a 
FormComponent but has to extend Repeater.

++

-- 
Joseph Pachod
IT

THOMAS DAILY GmbH
Adlerstraße 19
79098 Freiburg
Deutschland
T  + 49 761 3 85 59 506
F  + 49 761 3 85 59 550
E  joseph.pachod@thomas-daily.de
www.thomas-daily.de

Geschäftsführer/Managing Directors:
Wendy Thomas, Susanne Larbig
Handelsregister Freiburg i.Br., HRB 3947

Registrieren Sie sich unter https://www.thomas-daily.de/user/sign-in für die TD Morning News, eine kostenlose Auswahl aktueller Themen aus TD Premium, morgens ab 9:15 in Ihrer Mailbox.

Aktuelle Presseinformationen für die TD Morning News und TD Premium nimmt unsere Redaktion unter redaktion@thomas-daily.de entgegen.
Redaktionsschluss für die TD Morning News ist täglich um 8:45.

Register free of charge at https://www.thomas-daily.de/user/sign-in to have the TD Morning News, a selection of the latest topics from TD Premium, delivered to your mailbox from 9:15 every morning.

Our editorial department receives the latest press releases for the TD Morning News and TD Premium at redaktion@thomas-daily.de. The editorial deadline for the TD Morning News is 8.45am daily. 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: IVisitor and IFormModelUpdateListener not extending Component

Posted by Joseph Pachod <jp...@thomas-daily.de>.
Joseph Pachod wrote:
> Johan Compagner wrote:
>> you can use:
>>
>>     public final <S extends Component> Object visitChildren(final 
>> Class<?> clazz,
>>         final IVisitor<S> visitor)
>>
>>
>> then you have to cast yes, but you can cast safely.
>>
>> johan
>>
>>   
> I don't get it, sorry. How could I cast safely there ?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
I got it, sorry !

Yes indeed, feels already better :)

++

-- 
Joseph Pachod
IT

THOMAS DAILY GmbH
Adlerstraße 19
79098 Freiburg
Deutschland
T  + 49 761 3 85 59 506
F  + 49 761 3 85 59 550
E  joseph.pachod@thomas-daily.de
www.thomas-daily.de

Geschäftsführer/Managing Directors:
Wendy Thomas, Susanne Larbig
Handelsregister Freiburg i.Br., HRB 3947

Registrieren Sie sich unter https://www.thomas-daily.de/user/sign-in für die TD Morning News, eine kostenlose Auswahl aktueller Themen aus TD Premium, morgens ab 9:15 in Ihrer Mailbox.

Aktuelle Presseinformationen für die TD Morning News und TD Premium nimmt unsere Redaktion unter redaktion@thomas-daily.de entgegen.
Redaktionsschluss für die TD Morning News ist täglich um 8:45.

Register free of charge at https://www.thomas-daily.de/user/sign-in to have the TD Morning News, a selection of the latest topics from TD Premium, delivered to your mailbox from 9:15 every morning.

Our editorial department receives the latest press releases for the TD Morning News and TD Premium at redaktion@thomas-daily.de. The editorial deadline for the TD Morning News is 8.45am daily. 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: IVisitor and IFormModelUpdateListener not extending Component

Posted by Joseph Pachod <jp...@thomas-daily.de>.
Johan Compagner wrote:
> you can use:
>
> 	public final <S extends Component> Object visitChildren(final Class<?> clazz,
> 		final IVisitor<S> visitor)
>
>
> then you have to cast yes, but you can cast safely.
>
> johan
>
>   
I don't get it, sorry. How could I cast safely there ?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org