You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Artur W." <a_...@gazeta.pl> on 2008/10/28 12:23:23 UTC

Migration to 1.4 - generic headache

Hi Guys,

In the weekend I tried to migrate our application to wicket 1.4.
I was very happy to use generics with wicket but now I frustrated.

I love Wicket and I know it is nobody fault (it java fault! :)) but the
generics sucks.

Our application is quite big, more than one thousand classes and after
adding generics
the code looks awful and it is unreadable. I could live with that but
especially frustrating are
more than 4.000 warnings that I have now.

Most of them I cannot fix. For example the warnings apply to the components
that don't have models but I have to add them a type. What type? Any?
Example:

add(new Link("link") { //warning here
@Override
public void onClick() {
//do something here
}
});

I have a warning here because I didn't set a type of Link. But it doesn't
have any model. I know I can add @SuppressWarnings("unchecked") but I don't
want to do
that in more than 4000 places in my code. If I do than I will loose all the
warnign event that I would to have or could save me in the future.

So a question is there any way to workaround about this warnings problem?
I don't want to stay with wicket 1.3 because I realize that it will be
abandon in a year or something.


Thanks in advance,
Artur

-- 
View this message in context: http://www.nabble.com/Migration-to-1.4---generic-headache-tp20205449p20205449.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Migration to 1.4 - generic headache

Posted by Igor Vaynberg <ig...@gmail.com>.
On Wed, Oct 29, 2008 at 1:13 AM, Artur W. <a_...@gazeta.pl> wrote:
>
> Hi Igor,
>
>
> igor.vaynberg wrote:
>>
>> yes it sucks. i agree. personally i prefer code written against wicket
>> 1.3. even in 1.3 i hardly had to cast anything and even with those
>> casts i do not remember getting any class cast exceptions.
>>
>
> It is nice to know that somebody thinks similar to me :)
>
> The generics in Wicket looks nice on examples. But in bigger application
> (we have aprox. 500k loc) it is a mess. Especially when we use lots of
> forms, models, adapters and so on. We must write more code than in 1.3
> and we do not get any reward for it ;)

i think there is a lot of reward for using generics even how they are
now, but there are a lot of times when it does suck.

> I'm thinking now whether cancel migration and stay with wicket 1.3 or
> add this all voids and questions marks (thanks Stefan!) and get used to it.

that is up to you.

> How long do you want to support (bug fixing, adding small improvements to
> 1.3)

we no longer add new improvements to 1.3. it is purely in maintenance
mode. once 1.4.2 is out we will probably end support for 1.3
altogether. we do not have the resources to maintain two branches.

> and when do you plan do release 1.5 :)

not for a while. i would say a first milestone in about 5 months, maybe

the thing with the generics and how they are in 1.4 is that they are
half way to how i envision them in 1.5. so migration wise it will be
easier to go from 1.4->1.5 then from 1.3->1.5 because at least you
have your models generified and your component constructors expect the
right model types.

-igor

> Thanks in advance for your advices.
> Artur
>
> --
> View this message in context: http://www.nabble.com/Migration-to-1.4---generic-headache-tp20205449p20222475.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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: Migration to 1.4 - generic headache

Posted by "Artur W." <a_...@gazeta.pl>.
Hi Igor,


igor.vaynberg wrote:
> 
> yes it sucks. i agree. personally i prefer code written against wicket
> 1.3. even in 1.3 i hardly had to cast anything and even with those
> casts i do not remember getting any class cast exceptions.
> 

It is nice to know that somebody thinks similar to me :)

The generics in Wicket looks nice on examples. But in bigger application
(we have aprox. 500k loc) it is a mess. Especially when we use lots of
forms, models, adapters and so on. We must write more code than in 1.3
and we do not get any reward for it ;)

I'm thinking now whether cancel migration and stay with wicket 1.3 or
add this all voids and questions marks (thanks Stefan!) and get used to it.

How long do you want to support (bug fixing, adding small improvements to
1.3)
and when do you plan do release 1.5 :)

Thanks in advance for your advices.
Artur

-- 
View this message in context: http://www.nabble.com/Migration-to-1.4---generic-headache-tp20205449p20222475.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Migration to 1.4 - generic headache

Posted by Johan Compagner <jc...@gmail.com>.
just dont write those!

On Wed, Oct 29, 2008 at 5:18 PM, Igor Vaynberg <ig...@gmail.com>wrote:

> yes, the inherited will have to most likely go away - but that is
> there only for the CPM.
>
> the icomponentassignedmodel is already broken if a component has more
> then one model because you have to manually call wrap() on those
> anyways...lately ive been writing a lot of components that take more
> then one model so i noticed this :)
>
> -igor
>
> On Wed, Oct 29, 2008 at 8:59 AM, Johan Compagner <jc...@gmail.com>
> wrote:
> > its not just compound
> > we have 2 special cases for this:
> > IComponentAssignedModel and IComponentInheritedModel
> >
> > which will be both pretty tricky to do if the users must make a field for
> > the model them selfs.
> >
> > but we will see.
> >
> > johan
> >
> >
> > On Tue, Oct 28, 2008 at 5:22 PM, Igor Vaynberg <igor.vaynberg@gmail.com
> >wrote:
> >
> >> yes it sucks. i agree. personally i prefer code written against wicket
> >> 1.3. even in 1.3 i hardly had to cast anything and even with those
> >> casts i do not remember getting any class cast exceptions.
> >>
> >> i do think imodel<t> makes a ton of sense, but the types on components
> >> are pretty bad.
> >>
> >> in 1.5 i have an idea to fix it, but i am not sure it is going to work
> >> without giving up compound property model. the idea is to remove the
> >> default model from component completely and have user keep the model
> >> as a field. in ondetach() we can then detach any fields that are
> >> imodel via reflection. this will neatly solve all generics problems
> >> but it has limitations.
> >>
> >> anyways, we will see how it goes. until 1.4 i think the generics will
> >> stay the way they are unless we hear a ton of users complaining.
> >>
> >> -igor
> >>
> >> On Tue, Oct 28, 2008 at 4:23 AM, Artur W. <a_...@gazeta.pl> wrote:
> >> >
> >> > Hi Guys,
> >> >
> >> > In the weekend I tried to migrate our application to wicket 1.4.
> >> > I was very happy to use generics with wicket but now I frustrated.
> >> >
> >> > I love Wicket and I know it is nobody fault (it java fault! :)) but
> the
> >> > generics sucks.
> >> >
> >> > Our application is quite big, more than one thousand classes and after
> >> > adding generics
> >> > the code looks awful and it is unreadable. I could live with that but
> >> > especially frustrating are
> >> > more than 4.000 warnings that I have now.
> >> >
> >> > Most of them I cannot fix. For example the warnings apply to the
> >> components
> >> > that don't have models but I have to add them a type. What type? Any?
> >> > Example:
> >> >
> >> > add(new Link("link") { //warning here
> >> > @Override
> >> > public void onClick() {
> >> > //do something here
> >> > }
> >> > });
> >> >
> >> > I have a warning here because I didn't set a type of Link. But it
> doesn't
> >> > have any model. I know I can add @SuppressWarnings("unchecked") but I
> >> don't
> >> > want to do
> >> > that in more than 4000 places in my code. If I do than I will loose
> all
> >> the
> >> > warnign event that I would to have or could save me in the future.
> >> >
> >> > So a question is there any way to workaround about this warnings
> problem?
> >> > I don't want to stay with wicket 1.3 because I realize that it will be
> >> > abandon in a year or something.
> >> >
> >> >
> >> > Thanks in advance,
> >> > Artur
> >> >
> >> > --
> >> > View this message in context:
> >>
> http://www.nabble.com/Migration-to-1.4---generic-headache-tp20205449p20205449.html
> >> > Sent from the Wicket - User mailing list archive at Nabble.com.
> >> >
> >> >
> >> > ---------------------------------------------------------------------
> >> > 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: Migration to 1.4 - generic headache

Posted by Igor Vaynberg <ig...@gmail.com>.
yes, the inherited will have to most likely go away - but that is
there only for the CPM.

the icomponentassignedmodel is already broken if a component has more
then one model because you have to manually call wrap() on those
anyways...lately ive been writing a lot of components that take more
then one model so i noticed this :)

-igor

On Wed, Oct 29, 2008 at 8:59 AM, Johan Compagner <jc...@gmail.com> wrote:
> its not just compound
> we have 2 special cases for this:
> IComponentAssignedModel and IComponentInheritedModel
>
> which will be both pretty tricky to do if the users must make a field for
> the model them selfs.
>
> but we will see.
>
> johan
>
>
> On Tue, Oct 28, 2008 at 5:22 PM, Igor Vaynberg <ig...@gmail.com>wrote:
>
>> yes it sucks. i agree. personally i prefer code written against wicket
>> 1.3. even in 1.3 i hardly had to cast anything and even with those
>> casts i do not remember getting any class cast exceptions.
>>
>> i do think imodel<t> makes a ton of sense, but the types on components
>> are pretty bad.
>>
>> in 1.5 i have an idea to fix it, but i am not sure it is going to work
>> without giving up compound property model. the idea is to remove the
>> default model from component completely and have user keep the model
>> as a field. in ondetach() we can then detach any fields that are
>> imodel via reflection. this will neatly solve all generics problems
>> but it has limitations.
>>
>> anyways, we will see how it goes. until 1.4 i think the generics will
>> stay the way they are unless we hear a ton of users complaining.
>>
>> -igor
>>
>> On Tue, Oct 28, 2008 at 4:23 AM, Artur W. <a_...@gazeta.pl> wrote:
>> >
>> > Hi Guys,
>> >
>> > In the weekend I tried to migrate our application to wicket 1.4.
>> > I was very happy to use generics with wicket but now I frustrated.
>> >
>> > I love Wicket and I know it is nobody fault (it java fault! :)) but the
>> > generics sucks.
>> >
>> > Our application is quite big, more than one thousand classes and after
>> > adding generics
>> > the code looks awful and it is unreadable. I could live with that but
>> > especially frustrating are
>> > more than 4.000 warnings that I have now.
>> >
>> > Most of them I cannot fix. For example the warnings apply to the
>> components
>> > that don't have models but I have to add them a type. What type? Any?
>> > Example:
>> >
>> > add(new Link("link") { //warning here
>> > @Override
>> > public void onClick() {
>> > //do something here
>> > }
>> > });
>> >
>> > I have a warning here because I didn't set a type of Link. But it doesn't
>> > have any model. I know I can add @SuppressWarnings("unchecked") but I
>> don't
>> > want to do
>> > that in more than 4000 places in my code. If I do than I will loose all
>> the
>> > warnign event that I would to have or could save me in the future.
>> >
>> > So a question is there any way to workaround about this warnings problem?
>> > I don't want to stay with wicket 1.3 because I realize that it will be
>> > abandon in a year or something.
>> >
>> >
>> > Thanks in advance,
>> > Artur
>> >
>> > --
>> > View this message in context:
>> http://www.nabble.com/Migration-to-1.4---generic-headache-tp20205449p20205449.html
>> > Sent from the Wicket - User mailing list archive at Nabble.com.
>> >
>> >
>> > ---------------------------------------------------------------------
>> > 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: Migration to 1.4 - generic headache

Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
Yeah I for one would defiantly hate for compound model to go away..:(

But I guess one could come along away with propertymodel and when we get 
the proxybase model aproach in it could be okay.

[1] https://issues.apache.org/jira/browse/WICKET-1327



James Carman wrote:
> Those are definitely sticking points.  I guess we'll just have to
> evaluate what is better for the framework.  These two features are
> definitely convenient.
>
> On Wed, Oct 29, 2008 at 11:59 AM, Johan Compagner <jc...@gmail.com> wrote:
>   
>> its not just compound
>> we have 2 special cases for this:
>> IComponentAssignedModel and IComponentInheritedModel
>>
>> which will be both pretty tricky to do if the users must make a field for
>> the model them selfs.
>>
>> but we will see.
>>
>> johan
>>
>>
>> On Tue, Oct 28, 2008 at 5:22 PM, Igor Vaynberg <ig...@gmail.com>wrote:
>>
>>     
>>> yes it sucks. i agree. personally i prefer code written against wicket
>>> 1.3. even in 1.3 i hardly had to cast anything and even with those
>>> casts i do not remember getting any class cast exceptions.
>>>
>>> i do think imodel<t> makes a ton of sense, but the types on components
>>> are pretty bad.
>>>
>>> in 1.5 i have an idea to fix it, but i am not sure it is going to work
>>> without giving up compound property model. the idea is to remove the
>>> default model from component completely and have user keep the model
>>> as a field. in ondetach() we can then detach any fields that are
>>> imodel via reflection. this will neatly solve all generics problems
>>> but it has limitations.
>>>
>>> anyways, we will see how it goes. until 1.4 i think the generics will
>>> stay the way they are unless we hear a ton of users complaining.
>>>
>>> -igor
>>>
>>> On Tue, Oct 28, 2008 at 4:23 AM, Artur W. <a_...@gazeta.pl> wrote:
>>>       
>>>> Hi Guys,
>>>>
>>>> In the weekend I tried to migrate our application to wicket 1.4.
>>>> I was very happy to use generics with wicket but now I frustrated.
>>>>
>>>> I love Wicket and I know it is nobody fault (it java fault! :)) but the
>>>> generics sucks.
>>>>
>>>> Our application is quite big, more than one thousand classes and after
>>>> adding generics
>>>> the code looks awful and it is unreadable. I could live with that but
>>>> especially frustrating are
>>>> more than 4.000 warnings that I have now.
>>>>
>>>> Most of them I cannot fix. For example the warnings apply to the
>>>>         
>>> components
>>>       
>>>> that don't have models but I have to add them a type. What type? Any?
>>>> Example:
>>>>
>>>> add(new Link("link") { //warning here
>>>> @Override
>>>> public void onClick() {
>>>> //do something here
>>>> }
>>>> });
>>>>
>>>> I have a warning here because I didn't set a type of Link. But it doesn't
>>>> have any model. I know I can add @SuppressWarnings("unchecked") but I
>>>>         
>>> don't
>>>       
>>>> want to do
>>>> that in more than 4000 places in my code. If I do than I will loose all
>>>>         
>>> the
>>>       
>>>> warnign event that I would to have or could save me in the future.
>>>>
>>>> So a question is there any way to workaround about this warnings problem?
>>>> I don't want to stay with wicket 1.3 because I realize that it will be
>>>> abandon in a year or something.
>>>>
>>>>
>>>> Thanks in advance,
>>>> Artur
>>>>
>>>> --
>>>> View this message in context:
>>>>         
>>> http://www.nabble.com/Migration-to-1.4---generic-headache-tp20205449p20205449.html
>>>       
>>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>
>   

-- 
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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


Re: Migration to 1.4 - generic headache

Posted by James Carman <ja...@carmanconsulting.com>.
Those are definitely sticking points.  I guess we'll just have to
evaluate what is better for the framework.  These two features are
definitely convenient.

On Wed, Oct 29, 2008 at 11:59 AM, Johan Compagner <jc...@gmail.com> wrote:
> its not just compound
> we have 2 special cases for this:
> IComponentAssignedModel and IComponentInheritedModel
>
> which will be both pretty tricky to do if the users must make a field for
> the model them selfs.
>
> but we will see.
>
> johan
>
>
> On Tue, Oct 28, 2008 at 5:22 PM, Igor Vaynberg <ig...@gmail.com>wrote:
>
>> yes it sucks. i agree. personally i prefer code written against wicket
>> 1.3. even in 1.3 i hardly had to cast anything and even with those
>> casts i do not remember getting any class cast exceptions.
>>
>> i do think imodel<t> makes a ton of sense, but the types on components
>> are pretty bad.
>>
>> in 1.5 i have an idea to fix it, but i am not sure it is going to work
>> without giving up compound property model. the idea is to remove the
>> default model from component completely and have user keep the model
>> as a field. in ondetach() we can then detach any fields that are
>> imodel via reflection. this will neatly solve all generics problems
>> but it has limitations.
>>
>> anyways, we will see how it goes. until 1.4 i think the generics will
>> stay the way they are unless we hear a ton of users complaining.
>>
>> -igor
>>
>> On Tue, Oct 28, 2008 at 4:23 AM, Artur W. <a_...@gazeta.pl> wrote:
>> >
>> > Hi Guys,
>> >
>> > In the weekend I tried to migrate our application to wicket 1.4.
>> > I was very happy to use generics with wicket but now I frustrated.
>> >
>> > I love Wicket and I know it is nobody fault (it java fault! :)) but the
>> > generics sucks.
>> >
>> > Our application is quite big, more than one thousand classes and after
>> > adding generics
>> > the code looks awful and it is unreadable. I could live with that but
>> > especially frustrating are
>> > more than 4.000 warnings that I have now.
>> >
>> > Most of them I cannot fix. For example the warnings apply to the
>> components
>> > that don't have models but I have to add them a type. What type? Any?
>> > Example:
>> >
>> > add(new Link("link") { //warning here
>> > @Override
>> > public void onClick() {
>> > //do something here
>> > }
>> > });
>> >
>> > I have a warning here because I didn't set a type of Link. But it doesn't
>> > have any model. I know I can add @SuppressWarnings("unchecked") but I
>> don't
>> > want to do
>> > that in more than 4000 places in my code. If I do than I will loose all
>> the
>> > warnign event that I would to have or could save me in the future.
>> >
>> > So a question is there any way to workaround about this warnings problem?
>> > I don't want to stay with wicket 1.3 because I realize that it will be
>> > abandon in a year or something.
>> >
>> >
>> > Thanks in advance,
>> > Artur
>> >
>> > --
>> > View this message in context:
>> http://www.nabble.com/Migration-to-1.4---generic-headache-tp20205449p20205449.html
>> > Sent from the Wicket - User mailing list archive at Nabble.com.
>> >
>> >
>> > ---------------------------------------------------------------------
>> > 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: Migration to 1.4 - generic headache

Posted by Johan Compagner <jc...@gmail.com>.
its not just compound
we have 2 special cases for this:
IComponentAssignedModel and IComponentInheritedModel

which will be both pretty tricky to do if the users must make a field for
the model them selfs.

but we will see.

johan


On Tue, Oct 28, 2008 at 5:22 PM, Igor Vaynberg <ig...@gmail.com>wrote:

> yes it sucks. i agree. personally i prefer code written against wicket
> 1.3. even in 1.3 i hardly had to cast anything and even with those
> casts i do not remember getting any class cast exceptions.
>
> i do think imodel<t> makes a ton of sense, but the types on components
> are pretty bad.
>
> in 1.5 i have an idea to fix it, but i am not sure it is going to work
> without giving up compound property model. the idea is to remove the
> default model from component completely and have user keep the model
> as a field. in ondetach() we can then detach any fields that are
> imodel via reflection. this will neatly solve all generics problems
> but it has limitations.
>
> anyways, we will see how it goes. until 1.4 i think the generics will
> stay the way they are unless we hear a ton of users complaining.
>
> -igor
>
> On Tue, Oct 28, 2008 at 4:23 AM, Artur W. <a_...@gazeta.pl> wrote:
> >
> > Hi Guys,
> >
> > In the weekend I tried to migrate our application to wicket 1.4.
> > I was very happy to use generics with wicket but now I frustrated.
> >
> > I love Wicket and I know it is nobody fault (it java fault! :)) but the
> > generics sucks.
> >
> > Our application is quite big, more than one thousand classes and after
> > adding generics
> > the code looks awful and it is unreadable. I could live with that but
> > especially frustrating are
> > more than 4.000 warnings that I have now.
> >
> > Most of them I cannot fix. For example the warnings apply to the
> components
> > that don't have models but I have to add them a type. What type? Any?
> > Example:
> >
> > add(new Link("link") { //warning here
> > @Override
> > public void onClick() {
> > //do something here
> > }
> > });
> >
> > I have a warning here because I didn't set a type of Link. But it doesn't
> > have any model. I know I can add @SuppressWarnings("unchecked") but I
> don't
> > want to do
> > that in more than 4000 places in my code. If I do than I will loose all
> the
> > warnign event that I would to have or could save me in the future.
> >
> > So a question is there any way to workaround about this warnings problem?
> > I don't want to stay with wicket 1.3 because I realize that it will be
> > abandon in a year or something.
> >
> >
> > Thanks in advance,
> > Artur
> >
> > --
> > View this message in context:
> http://www.nabble.com/Migration-to-1.4---generic-headache-tp20205449p20205449.html
> > Sent from the Wicket - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > 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: Migration to 1.4 - generic headache

Posted by Igor Vaynberg <ig...@gmail.com>.
the fact remains that there are components that are sometimes used
with a model and sometimes without one. as it is we only generify
components that we *think* are most likely to be used with a model,
this is why we spent many an hour backing out generics from Component.

it is too bad that java does not have a way to default to a type if
one is not specified, but that is java's limitation.

-igor

On Wed, Oct 29, 2008 at 8:46 AM, Jan Kriesten <ja...@renitence.de> wrote:
>
> Hi Igor,
>
>> you are against generics completely. but they are going to happen. the
>> way they are now is not perfect, in 1.5 we will try to move them to a
>> better place, but like it or not they are here to stay.
>
> huh - hell, no, I'm not against generics at all. Where do you get that from? I'm
> against generics on Components which are not FormComponents (or ListViews)!
>
> I'm using Wicket together with Scala and other than with Java, I can't just drop
> the generics attributes (and live with the warnings). And the <Void> is really a
> hell of a generic...
>
> Generics on Models are what is needed and if your vision to decouple models from
> the component and use introspection/reflection to support them comes true I'd be
> quite happy (and could use Scala's mixin-feature to have my model functionality
> on the components).
>
> Best regards, --- Jan.
>
>
>
> ---------------------------------------------------------------------
> 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: Migration to 1.4 - generic headache

Posted by Igor Vaynberg <ig...@gmail.com>.
this only works for subclasses.

and if you do class myclass<a,b> extends otherclass<b> you have to map
the entire class hierarchy to figure out how [0] maps to your expected
type. in the example above you actually want [1].

-igor

On Fri, Oct 31, 2008 at 7:23 AM, Bernard Niset <bn...@smartobjects.be> wrote:
> Hi Martin,
> There *is* a way to evaluate the type parameter at runtime. Something like
> the following will give you the first type used:
>
> (Class<T>) ((ParameterizedType) getClass()
>               .getGenericSuperclass()).getActualTypeArguments()[0]
>
> Regards,
> Bernard.
>
> Martin Voigt a écrit :
>>
>> if we could get something like
>>
>> <T default Void>
>>
>> from sun, all my generics problems would go away.
>>
>> no code clutter anymore just because you "generify" classes that
>> should be. and type safety would still be ensured at runtime. if the
>> vm would give me a way to evaluate the type parameter at runtime, i'd
>> be more than happy, but that will stay a dream for a long time ;)
>>
>> Regards,
>> Martin
>>
>> 2008/10/30 Ricky <ri...@gmail.com>:
>>
>>>
>>> I don't know if i should speak up amongst elite group of people
>>> discussing,
>>> but hey i'll try ... :)
>>>
>>> From what i understand most people have issues with readability of
>>> generics;
>>> but as i have indicated time and again as java improves and generic types
>>> become reified; and java becomes inferred static typed; generic notation
>>> will be less DRY violating and more clear.
>>>
>>> But its the conceptual approach that i am not sure I am following (which
>>> is
>>> why said may be I shouldn't be posting this :)). A component has to have
>>> an
>>> associated model type with it. Generifying models is mandatory... but
>>> from
>>> what i see; not generifying components would be a big mistake.
>>>
>>> I cannot see any model less component. A component interacts with
>>> underlying
>>> application data using model wrapper ... that was the beauty of wicket
>>> that
>>> i had come to love the most and if now we are saying that it is valid in
>>> some cases and in some it isn't is contradictory. If anything; for
>>> consistency sake we should go with component level generification. But i
>>> guess i am in the minority in that issue.
>>>
>>> Generics is something that java developers have to get used to and it
>>> takes
>>> some time ... but just because it takes some time; we should choose a
>>> middle
>>> ground solution isn't exactly right; may be more practical (oh well ;) ).
>>>
>>> On Thu, Oct 30, 2008 at 2:34 PM, Johan Compagner
>>> <jc...@gmail.com>wrote:
>>>
>>>
>>>>
>>>> i agree and we only need 2 things to be fixed improved by sun and then
>>>> all
>>>> the current problems are completely gone....
>>>> But i guess we never get them
>>>> Because they find JavaFX way more importand.. I am glad the focused on
>>>> that
>>>> because it gave us Java6U10 but that whole JavaFX i dont have much hope
>>>> for
>>>> that.
>>>>
>>>> johan
>>>>
>>>>
>>>> On Thu, Oct 30, 2008 at 6:25 PM, Edward <ed...@wicketbits.aezix.com>
>>>> wrote:
>>>>
>>>>
>>>>>
>>>>> Well I'll speak up and say I don't like generics in Wicket.  I like
>>>>> them
>>>>>  in other places... just not here.  It is a lot of extra ugly code just
>>>>> to fix the rare occurrence that I have to cast the model object.
>>>>>
>>>>> Not to mention in my opinion it breaks the data abstraction the model
>>>>> provides.  Might as well get rid of the model all together.
>>>>>
>>>>> When I first started using Wicket I admit I was shocked there were no
>>>>> generics and I was accessing the model object all the time and casting.
>>>>>  As I got better at using Wicket though I found better ways of doing
>>>>> things and I believe I haven't done a cast even once in the past 6
>>>>> months - and I have developed some fairly complicated apps in that
>>>>> time.
>>>>>
>>>>> I think 1.3 is designed very well and I like it a lot.
>>>>>
>>>>> Edward
>>>>>
>>>>>
>>>>>
>>>>> Jan Kriesten wrote:
>>>>>
>>>>>
>>>>>>
>>>>>> Hi Igor,
>>>>>>
>>>>>>  you are against generics completely. but they are going to happen.
>>>>>> the
>>>>>>
>>>>>>>
>>>>>>> way they are now is not perfect, in 1.5 we will try to move them to a
>>>>>>> better place, but like it or not they are here to stay.
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> huh - hell, no, I'm not against generics at all. Where do you get that
>>>>>> from? I'm
>>>>>> against generics on Components which are not FormComponents (or
>>>>>> ListViews)!
>>>>>>
>>>>>> I'm using Wicket together with Scala and other than with Java, I can't
>>>>>> just drop
>>>>>> the generics attributes (and live with the warnings). And the <Void>
>>>>>> is
>>>>>> really a
>>>>>> hell of a generic...
>>>>>>
>>>>>> Generics on Models are what is needed and if your vision to decouple
>>>>>> models from
>>>>>> the component and use introspection/reflection to support them comes
>>>>>>
>>>>
>>>> true
>>>>
>>>>>>
>>>>>> I'd be
>>>>>> quite happy (and could use Scala's mixin-feature to have my model
>>>>>> functionality
>>>>>> on the components).
>>>>>>
>>>>>> Best regards, --- Jan.
>>>>>>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> 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
>>>>>
>>>>>
>>>>>
>>>
>>> --
>>>
>>> Regards
>>> Vyas, Anirudh
>>> ||  ॐ  ||
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Migration to 1.4 - generic headache

Posted by Bernard Niset <bn...@smartobjects.be>.
Hi Martin,
There *is* a way to evaluate the type parameter at runtime. Something 
like the following will give you the first type used:

(Class<T>) ((ParameterizedType) getClass()
                .getGenericSuperclass()).getActualTypeArguments()[0]

Regards,
Bernard.

Martin Voigt a écrit :
> if we could get something like
>
> <T default Void>
>
> from sun, all my generics problems would go away.
>
> no code clutter anymore just because you "generify" classes that
> should be. and type safety would still be ensured at runtime. if the
> vm would give me a way to evaluate the type parameter at runtime, i'd
> be more than happy, but that will stay a dream for a long time ;)
>
> Regards,
> Martin
>
> 2008/10/30 Ricky <ri...@gmail.com>:
>   
>> I don't know if i should speak up amongst elite group of people discussing,
>> but hey i'll try ... :)
>>
>> From what i understand most people have issues with readability of generics;
>> but as i have indicated time and again as java improves and generic types
>> become reified; and java becomes inferred static typed; generic notation
>> will be less DRY violating and more clear.
>>
>> But its the conceptual approach that i am not sure I am following (which is
>> why said may be I shouldn't be posting this :)). A component has to have an
>> associated model type with it. Generifying models is mandatory... but from
>> what i see; not generifying components would be a big mistake.
>>
>> I cannot see any model less component. A component interacts with underlying
>> application data using model wrapper ... that was the beauty of wicket that
>> i had come to love the most and if now we are saying that it is valid in
>> some cases and in some it isn't is contradictory. If anything; for
>> consistency sake we should go with component level generification. But i
>> guess i am in the minority in that issue.
>>
>> Generics is something that java developers have to get used to and it takes
>> some time ... but just because it takes some time; we should choose a middle
>> ground solution isn't exactly right; may be more practical (oh well ;) ).
>>
>> On Thu, Oct 30, 2008 at 2:34 PM, Johan Compagner <jc...@gmail.com>wrote:
>>
>>     
>>> i agree and we only need 2 things to be fixed improved by sun and then all
>>> the current problems are completely gone....
>>> But i guess we never get them
>>> Because they find JavaFX way more importand.. I am glad the focused on that
>>> because it gave us Java6U10 but that whole JavaFX i dont have much hope for
>>> that.
>>>
>>> johan
>>>
>>>
>>> On Thu, Oct 30, 2008 at 6:25 PM, Edward <ed...@wicketbits.aezix.com>
>>> wrote:
>>>
>>>       
>>>> Well I'll speak up and say I don't like generics in Wicket.  I like them
>>>>  in other places... just not here.  It is a lot of extra ugly code just
>>>> to fix the rare occurrence that I have to cast the model object.
>>>>
>>>> Not to mention in my opinion it breaks the data abstraction the model
>>>> provides.  Might as well get rid of the model all together.
>>>>
>>>> When I first started using Wicket I admit I was shocked there were no
>>>> generics and I was accessing the model object all the time and casting.
>>>>  As I got better at using Wicket though I found better ways of doing
>>>> things and I believe I haven't done a cast even once in the past 6
>>>> months - and I have developed some fairly complicated apps in that time.
>>>>
>>>> I think 1.3 is designed very well and I like it a lot.
>>>>
>>>> Edward
>>>>
>>>>
>>>>
>>>> Jan Kriesten wrote:
>>>>
>>>>         
>>>>> Hi Igor,
>>>>>
>>>>>  you are against generics completely. but they are going to happen. the
>>>>>           
>>>>>> way they are now is not perfect, in 1.5 we will try to move them to a
>>>>>> better place, but like it or not they are here to stay.
>>>>>>
>>>>>>             
>>>>> huh - hell, no, I'm not against generics at all. Where do you get that
>>>>> from? I'm
>>>>> against generics on Components which are not FormComponents (or
>>>>> ListViews)!
>>>>>
>>>>> I'm using Wicket together with Scala and other than with Java, I can't
>>>>> just drop
>>>>> the generics attributes (and live with the warnings). And the <Void> is
>>>>> really a
>>>>> hell of a generic...
>>>>>
>>>>> Generics on Models are what is needed and if your vision to decouple
>>>>> models from
>>>>> the component and use introspection/reflection to support them comes
>>>>>           
>>> true
>>>       
>>>>> I'd be
>>>>> quite happy (and could use Scala's mixin-feature to have my model
>>>>> functionality
>>>>> on the components).
>>>>>
>>>>> Best regards, --- Jan.
>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> 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
>>>>
>>>>
>>>>         
>>
>> --
>>
>> Regards
>> Vyas, Anirudh
>> ||  ॐ  ||
>>
>>     

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


Re: Migration to 1.4 - generic headache

Posted by Martin Voigt <vo...@googlemail.com>.
if we could get something like

<T default Void>

from sun, all my generics problems would go away.

no code clutter anymore just because you "generify" classes that
should be. and type safety would still be ensured at runtime. if the
vm would give me a way to evaluate the type parameter at runtime, i'd
be more than happy, but that will stay a dream for a long time ;)

Regards,
Martin

2008/10/30 Ricky <ri...@gmail.com>:
> I don't know if i should speak up amongst elite group of people discussing,
> but hey i'll try ... :)
>
> From what i understand most people have issues with readability of generics;
> but as i have indicated time and again as java improves and generic types
> become reified; and java becomes inferred static typed; generic notation
> will be less DRY violating and more clear.
>
> But its the conceptual approach that i am not sure I am following (which is
> why said may be I shouldn't be posting this :)). A component has to have an
> associated model type with it. Generifying models is mandatory... but from
> what i see; not generifying components would be a big mistake.
>
> I cannot see any model less component. A component interacts with underlying
> application data using model wrapper ... that was the beauty of wicket that
> i had come to love the most and if now we are saying that it is valid in
> some cases and in some it isn't is contradictory. If anything; for
> consistency sake we should go with component level generification. But i
> guess i am in the minority in that issue.
>
> Generics is something that java developers have to get used to and it takes
> some time ... but just because it takes some time; we should choose a middle
> ground solution isn't exactly right; may be more practical (oh well ;) ).
>
> On Thu, Oct 30, 2008 at 2:34 PM, Johan Compagner <jc...@gmail.com>wrote:
>
>> i agree and we only need 2 things to be fixed improved by sun and then all
>> the current problems are completely gone....
>> But i guess we never get them
>> Because they find JavaFX way more importand.. I am glad the focused on that
>> because it gave us Java6U10 but that whole JavaFX i dont have much hope for
>> that.
>>
>> johan
>>
>>
>> On Thu, Oct 30, 2008 at 6:25 PM, Edward <ed...@wicketbits.aezix.com>
>> wrote:
>>
>> >
>> > Well I'll speak up and say I don't like generics in Wicket.  I like them
>> >  in other places... just not here.  It is a lot of extra ugly code just
>> > to fix the rare occurrence that I have to cast the model object.
>> >
>> > Not to mention in my opinion it breaks the data abstraction the model
>> > provides.  Might as well get rid of the model all together.
>> >
>> > When I first started using Wicket I admit I was shocked there were no
>> > generics and I was accessing the model object all the time and casting.
>> >  As I got better at using Wicket though I found better ways of doing
>> > things and I believe I haven't done a cast even once in the past 6
>> > months - and I have developed some fairly complicated apps in that time.
>> >
>> > I think 1.3 is designed very well and I like it a lot.
>> >
>> > Edward
>> >
>> >
>> >
>> > Jan Kriesten wrote:
>> >
>> >> Hi Igor,
>> >>
>> >>  you are against generics completely. but they are going to happen. the
>> >>> way they are now is not perfect, in 1.5 we will try to move them to a
>> >>> better place, but like it or not they are here to stay.
>> >>>
>> >>
>> >> huh - hell, no, I'm not against generics at all. Where do you get that
>> >> from? I'm
>> >> against generics on Components which are not FormComponents (or
>> >> ListViews)!
>> >>
>> >> I'm using Wicket together with Scala and other than with Java, I can't
>> >> just drop
>> >> the generics attributes (and live with the warnings). And the <Void> is
>> >> really a
>> >> hell of a generic...
>> >>
>> >> Generics on Models are what is needed and if your vision to decouple
>> >> models from
>> >> the component and use introspection/reflection to support them comes
>> true
>> >> I'd be
>> >> quite happy (and could use Scala's mixin-feature to have my model
>> >> functionality
>> >> on the components).
>> >>
>> >> Best regards, --- Jan.
>> >>
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> 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
>> >
>> >
>>
>
>
>
> --
>
> Regards
> Vyas, Anirudh
> ||  ॐ  ||
>

Re: Migration to 1.4 - generic headache

Posted by Ricky <ri...@gmail.com>.
I don't know if i should speak up amongst elite group of people discussing,
but hey i'll try ... :)

From what i understand most people have issues with readability of generics;
but as i have indicated time and again as java improves and generic types
become reified; and java becomes inferred static typed; generic notation
will be less DRY violating and more clear.

But its the conceptual approach that i am not sure I am following (which is
why said may be I shouldn't be posting this :)). A component has to have an
associated model type with it. Generifying models is mandatory... but from
what i see; not generifying components would be a big mistake.

I cannot see any model less component. A component interacts with underlying
application data using model wrapper ... that was the beauty of wicket that
i had come to love the most and if now we are saying that it is valid in
some cases and in some it isn't is contradictory. If anything; for
consistency sake we should go with component level generification. But i
guess i am in the minority in that issue.

Generics is something that java developers have to get used to and it takes
some time ... but just because it takes some time; we should choose a middle
ground solution isn't exactly right; may be more practical (oh well ;) ).

On Thu, Oct 30, 2008 at 2:34 PM, Johan Compagner <jc...@gmail.com>wrote:

> i agree and we only need 2 things to be fixed improved by sun and then all
> the current problems are completely gone....
> But i guess we never get them
> Because they find JavaFX way more importand.. I am glad the focused on that
> because it gave us Java6U10 but that whole JavaFX i dont have much hope for
> that.
>
> johan
>
>
> On Thu, Oct 30, 2008 at 6:25 PM, Edward <ed...@wicketbits.aezix.com>
> wrote:
>
> >
> > Well I'll speak up and say I don't like generics in Wicket.  I like them
> >  in other places... just not here.  It is a lot of extra ugly code just
> > to fix the rare occurrence that I have to cast the model object.
> >
> > Not to mention in my opinion it breaks the data abstraction the model
> > provides.  Might as well get rid of the model all together.
> >
> > When I first started using Wicket I admit I was shocked there were no
> > generics and I was accessing the model object all the time and casting.
> >  As I got better at using Wicket though I found better ways of doing
> > things and I believe I haven't done a cast even once in the past 6
> > months - and I have developed some fairly complicated apps in that time.
> >
> > I think 1.3 is designed very well and I like it a lot.
> >
> > Edward
> >
> >
> >
> > Jan Kriesten wrote:
> >
> >> Hi Igor,
> >>
> >>  you are against generics completely. but they are going to happen. the
> >>> way they are now is not perfect, in 1.5 we will try to move them to a
> >>> better place, but like it or not they are here to stay.
> >>>
> >>
> >> huh - hell, no, I'm not against generics at all. Where do you get that
> >> from? I'm
> >> against generics on Components which are not FormComponents (or
> >> ListViews)!
> >>
> >> I'm using Wicket together with Scala and other than with Java, I can't
> >> just drop
> >> the generics attributes (and live with the warnings). And the <Void> is
> >> really a
> >> hell of a generic...
> >>
> >> Generics on Models are what is needed and if your vision to decouple
> >> models from
> >> the component and use introspection/reflection to support them comes
> true
> >> I'd be
> >> quite happy (and could use Scala's mixin-feature to have my model
> >> functionality
> >> on the components).
> >>
> >> Best regards, --- Jan.
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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
> >
> >
>



-- 

Regards
Vyas, Anirudh
||  ॐ  ||

Re: Migration to 1.4 - generic headache

Posted by Johan Compagner <jc...@gmail.com>.
i agree and we only need 2 things to be fixed improved by sun and then all
the current problems are completely gone....
But i guess we never get them
Because they find JavaFX way more importand.. I am glad the focused on that
because it gave us Java6U10 but that whole JavaFX i dont have much hope for
that.

johan


On Thu, Oct 30, 2008 at 6:25 PM, Edward <ed...@wicketbits.aezix.com> wrote:

>
> Well I'll speak up and say I don't like generics in Wicket.  I like them
>  in other places... just not here.  It is a lot of extra ugly code just
> to fix the rare occurrence that I have to cast the model object.
>
> Not to mention in my opinion it breaks the data abstraction the model
> provides.  Might as well get rid of the model all together.
>
> When I first started using Wicket I admit I was shocked there were no
> generics and I was accessing the model object all the time and casting.
>  As I got better at using Wicket though I found better ways of doing
> things and I believe I haven't done a cast even once in the past 6
> months - and I have developed some fairly complicated apps in that time.
>
> I think 1.3 is designed very well and I like it a lot.
>
> Edward
>
>
>
> Jan Kriesten wrote:
>
>> Hi Igor,
>>
>>  you are against generics completely. but they are going to happen. the
>>> way they are now is not perfect, in 1.5 we will try to move them to a
>>> better place, but like it or not they are here to stay.
>>>
>>
>> huh - hell, no, I'm not against generics at all. Where do you get that
>> from? I'm
>> against generics on Components which are not FormComponents (or
>> ListViews)!
>>
>> I'm using Wicket together with Scala and other than with Java, I can't
>> just drop
>> the generics attributes (and live with the warnings). And the <Void> is
>> really a
>> hell of a generic...
>>
>> Generics on Models are what is needed and if your vision to decouple
>> models from
>> the component and use introspection/reflection to support them comes true
>> I'd be
>> quite happy (and could use Scala's mixin-feature to have my model
>> functionality
>> on the components).
>>
>> Best regards, --- Jan.
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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: Migration to 1.4 - generic headache

Posted by Edward <ed...@wicketbits.aezix.com>.
Well I'll speak up and say I don't like generics in Wicket.  I like them
  in other places... just not here.  It is a lot of extra ugly code just
to fix the rare occurrence that I have to cast the model object.

Not to mention in my opinion it breaks the data abstraction the model
provides.  Might as well get rid of the model all together.

When I first started using Wicket I admit I was shocked there were no
generics and I was accessing the model object all the time and casting.
  As I got better at using Wicket though I found better ways of doing
things and I believe I haven't done a cast even once in the past 6
months - and I have developed some fairly complicated apps in that time.

I think 1.3 is designed very well and I like it a lot.

Edward


Jan Kriesten wrote:
> Hi Igor,
> 
>> you are against generics completely. but they are going to happen. the
>> way they are now is not perfect, in 1.5 we will try to move them to a
>> better place, but like it or not they are here to stay.
> 
> huh - hell, no, I'm not against generics at all. Where do you get that from? I'm
> against generics on Components which are not FormComponents (or ListViews)!
> 
> I'm using Wicket together with Scala and other than with Java, I can't just drop
> the generics attributes (and live with the warnings). And the <Void> is really a
> hell of a generic...
> 
> Generics on Models are what is needed and if your vision to decouple models from
> the component and use introspection/reflection to support them comes true I'd be
> quite happy (and could use Scala's mixin-feature to have my model functionality
> on the components).
> 
> Best regards, --- Jan.
> 
> 
> 
> ---------------------------------------------------------------------
> 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: Migration to 1.4 - generic headache

Posted by Jan Kriesten <ja...@renitence.de>.
Hi Igor,

> you are against generics completely. but they are going to happen. the
> way they are now is not perfect, in 1.5 we will try to move them to a
> better place, but like it or not they are here to stay.

huh - hell, no, I'm not against generics at all. Where do you get that from? I'm
against generics on Components which are not FormComponents (or ListViews)!

I'm using Wicket together with Scala and other than with Java, I can't just drop
the generics attributes (and live with the warnings). And the <Void> is really a
hell of a generic...

Generics on Models are what is needed and if your vision to decouple models from
the component and use introspection/reflection to support them comes true I'd be
quite happy (and could use Scala's mixin-feature to have my model functionality
on the components).

Best regards, --- Jan.



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


Re: Migration to 1.4 - generic headache

Posted by Igor Vaynberg <ig...@gmail.com>.
you are against generics completely. but they are going to happen. the
way they are now is not perfect, in 1.5 we will try to move them to a
better place, but like it or not they are here to stay.

-igor

On Wed, Oct 29, 2008 at 1:28 AM, Jan Kriesten
<kr...@mail.footprint.de> wrote:
>
> Hi Igor,
>
>> yes it sucks. i agree. personally i prefer code written against wicket
>> 1.3. even in 1.3 i hardly had to cast anything and even with those
>> casts i do not remember getting any class cast exceptions.
>
> hehe - just as I was saying months ago. *g*
>
>> anyways, we will see how it goes. until 1.4 i think the generics will
>> stay the way they are unless we hear a ton of users complaining.
>
> If you need someone to complain you may always call on me. :D
>
> --- Jan.
>
>
>
> ---------------------------------------------------------------------
> 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: Migration to 1.4 - generic headache

Posted by Jan Kriesten <kr...@mail.footprint.de>.
Hi Igor,

> yes it sucks. i agree. personally i prefer code written against wicket
> 1.3. even in 1.3 i hardly had to cast anything and even with those
> casts i do not remember getting any class cast exceptions.

hehe - just as I was saying months ago. *g*

> anyways, we will see how it goes. until 1.4 i think the generics will
> stay the way they are unless we hear a ton of users complaining.

If you need someone to complain you may always call on me. :D

--- Jan.



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


Re: Migration to 1.4 - generic headache

Posted by Igor Vaynberg <ig...@gmail.com>.
yes it sucks. i agree. personally i prefer code written against wicket
1.3. even in 1.3 i hardly had to cast anything and even with those
casts i do not remember getting any class cast exceptions.

i do think imodel<t> makes a ton of sense, but the types on components
are pretty bad.

in 1.5 i have an idea to fix it, but i am not sure it is going to work
without giving up compound property model. the idea is to remove the
default model from component completely and have user keep the model
as a field. in ondetach() we can then detach any fields that are
imodel via reflection. this will neatly solve all generics problems
but it has limitations.

anyways, we will see how it goes. until 1.4 i think the generics will
stay the way they are unless we hear a ton of users complaining.

-igor

On Tue, Oct 28, 2008 at 4:23 AM, Artur W. <a_...@gazeta.pl> wrote:
>
> Hi Guys,
>
> In the weekend I tried to migrate our application to wicket 1.4.
> I was very happy to use generics with wicket but now I frustrated.
>
> I love Wicket and I know it is nobody fault (it java fault! :)) but the
> generics sucks.
>
> Our application is quite big, more than one thousand classes and after
> adding generics
> the code looks awful and it is unreadable. I could live with that but
> especially frustrating are
> more than 4.000 warnings that I have now.
>
> Most of them I cannot fix. For example the warnings apply to the components
> that don't have models but I have to add them a type. What type? Any?
> Example:
>
> add(new Link("link") { //warning here
> @Override
> public void onClick() {
> //do something here
> }
> });
>
> I have a warning here because I didn't set a type of Link. But it doesn't
> have any model. I know I can add @SuppressWarnings("unchecked") but I don't
> want to do
> that in more than 4000 places in my code. If I do than I will loose all the
> warnign event that I would to have or could save me in the future.
>
> So a question is there any way to workaround about this warnings problem?
> I don't want to stay with wicket 1.3 because I realize that it will be
> abandon in a year or something.
>
>
> Thanks in advance,
> Artur
>
> --
> View this message in context: http://www.nabble.com/Migration-to-1.4---generic-headache-tp20205449p20205449.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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: Migration to 1.4 - generic headache

Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
But In the form case, It's really nice to be able todo 
form.getModelObject which if you use generics will return the right 
object with typesafety...

Unless you have forms which contain different classes, but that would 
not make much sense..

Stefan Lindner wrote:
> In this cases use
>
> new AjaxButton("cancelButton") {
> 	@Override
> 	protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
> 		modal.close(target);
>        }
> }
>
>
> -----Ursprüngliche Nachricht-----
> Von: Artur W. [mailto:a_wronski@gazeta.pl] 
> Gesendet: Dienstag, 28. Oktober 2008 12:40
> An: users@wicket.apache.org
> Betreff: RE: Migration to 1.4 - generic headache
>
>
> Hi Stefan!
>
> Stefan Lindner wrote:
>   
>> Use a Void Link (Link<Void>) or create your own Link wrapper class
>>
>> 	Class MyLink extends Link<Void>
>>
>>     
>
> I know I can create a wrapper but it is a ugly was to solve my problem :/
>
> The Void think is a good idea but it doesn't work everywhere. For example
> this doesn't compile:
>
> new AjaxButton("cancelButton") {
> 	@Override
> 	protected void onSubmit(AjaxRequestTarget target, Form&lt;Void&gt; form) {
> 		modal.close(target);
>        }
> }
>
>
> Artur
>
>   

-- 
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


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


RE: Migration to 1.4 - generic headache

Posted by Stefan Lindner <li...@visionet.de>.
In this cases use

new AjaxButton("cancelButton") {
	@Override
	protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
		modal.close(target);
       }
}


-----Ursprüngliche Nachricht-----
Von: Artur W. [mailto:a_wronski@gazeta.pl] 
Gesendet: Dienstag, 28. Oktober 2008 12:40
An: users@wicket.apache.org
Betreff: RE: Migration to 1.4 - generic headache


Hi Stefan!

Stefan Lindner wrote:
> 
> Use a Void Link (Link<Void>) or create your own Link wrapper class
> 
> 	Class MyLink extends Link<Void>
> 

I know I can create a wrapper but it is a ugly was to solve my problem :/

The Void think is a good idea but it doesn't work everywhere. For example
this doesn't compile:

new AjaxButton("cancelButton") {
	@Override
	protected void onSubmit(AjaxRequestTarget target, Form&lt;Void&gt; form) {
		modal.close(target);
       }
}


Artur

-- 
View this message in context: http://www.nabble.com/Migration-to-1.4---generic-headache-tp20205449p20205654.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
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: Migration to 1.4 - generic headache

Posted by "Artur W." <a_...@gazeta.pl>.
Hi Stefan!

Stefan Lindner wrote:
> 
> Use a Void Link (Link<Void>) or create your own Link wrapper class
> 
> 	Class MyLink extends Link<Void>
> 

I know I can create a wrapper but it is a ugly was to solve my problem :/

The Void think is a good idea but it doesn't work everywhere. For example
this doesn't compile:

new AjaxButton("cancelButton") {
	@Override
	protected void onSubmit(AjaxRequestTarget target, Form&lt;Void&gt; form) {
		modal.close(target);
       }
}


Artur

-- 
View this message in context: http://www.nabble.com/Migration-to-1.4---generic-headache-tp20205449p20205654.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


RE: Migration to 1.4 - generic headache

Posted by Stefan Lindner <li...@visionet.de>.
Use a Void Link (Link<Void>) or create your own Link wrapper class

	Class MyLink extends Link<Void>

Stefan

-----Ursprüngliche Nachricht-----
Von: Artur W. [mailto:a_wronski@gazeta.pl] 
Gesendet: Dienstag, 28. Oktober 2008 12:23
An: users@wicket.apache.org
Betreff: Migration to 1.4 - generic headache


Hi Guys,

In the weekend I tried to migrate our application to wicket 1.4.
I was very happy to use generics with wicket but now I frustrated.

I love Wicket and I know it is nobody fault (it java fault! :)) but the
generics sucks.

Our application is quite big, more than one thousand classes and after
adding generics
the code looks awful and it is unreadable. I could live with that but
especially frustrating are
more than 4.000 warnings that I have now.

Most of them I cannot fix. For example the warnings apply to the components
that don't have models but I have to add them a type. What type? Any?
Example:

add(new Link("link") { //warning here
@Override
public void onClick() {
//do something here
}
});

I have a warning here because I didn't set a type of Link. But it doesn't
have any model. I know I can add @SuppressWarnings("unchecked") but I don't
want to do
that in more than 4000 places in my code. If I do than I will loose all the
warnign event that I would to have or could save me in the future.

So a question is there any way to workaround about this warnings problem?
I don't want to stay with wicket 1.3 because I realize that it will be
abandon in a year or something.


Thanks in advance,
Artur

-- 
View this message in context: http://www.nabble.com/Migration-to-1.4---generic-headache-tp20205449p20205449.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
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: Migration to 1.4 - generic headache

Posted by Johan Compagner <jc...@gmail.com>.
i added my comments on how generics should be in a javalobby/dzone thread
about java 7:

http://java.dzone.com/articles/java-7-and-art-patience

couldnt help myself :)

I think java 7 could help wicket in 2 areas
generics:
 class Foo<T default Void>
  {
    Foo(){}
    Foo(Bar<T>){}
  }

   better type inference Foo foo = new Foo(new Bar<String>()); then foo is
types as String
   the default keyword.Foo foo = new Foo(); then foo is typed to Void

Properties like:

Person#name (same as reflection but then dont have the string)
Person#address#country#name, this then returns a wrapper around that class
where you can say on get(personObject) and ofcourse can handle nulls. (set
can be a bit tricky with nulls, what to do then..)

or even on instances

personObject#name

where you then can call the value from personObject#name.get() gets the
value

johan



On Tue, Oct 28, 2008 at 12:23 PM, Artur W. <a_...@gazeta.pl> wrote:

>
> Hi Guys,
>
> In the weekend I tried to migrate our application to wicket 1.4.
> I was very happy to use generics with wicket but now I frustrated.
>
> I love Wicket and I know it is nobody fault (it java fault! :)) but the
> generics sucks.
>
> Our application is quite big, more than one thousand classes and after
> adding generics
> the code looks awful and it is unreadable. I could live with that but
> especially frustrating are
> more than 4.000 warnings that I have now.
>
> Most of them I cannot fix. For example the warnings apply to the components
> that don't have models but I have to add them a type. What type? Any?
> Example:
>
> add(new Link("link") { //warning here
> @Override
> public void onClick() {
> //do something here
> }
> });
>
> I have a warning here because I didn't set a type of Link. But it doesn't
> have any model. I know I can add @SuppressWarnings("unchecked") but I don't
> want to do
> that in more than 4000 places in my code. If I do than I will loose all the
> warnign event that I would to have or could save me in the future.
>
> So a question is there any way to workaround about this warnings problem?
> I don't want to stay with wicket 1.3 because I realize that it will be
> abandon in a year or something.
>
>
> Thanks in advance,
> Artur
>
> --
> View this message in context:
> http://www.nabble.com/Migration-to-1.4---generic-headache-tp20205449p20205449.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>