« Return to Thread: users, please give us your opinion: what is your take on generics with Wicket

Re: users, please give us your opinion: what is your take on generics with Wicket

by richardwilko :: Rate this Message:

Reply to Author | View in Thread


   [ x ] Can best be done in a limited fashion, where we only generify
IModel but not components. I care more about what generifying can do
for API clarity (declaring a component to only accept certain models
for instance) than static type checking.
 
   [ x ] Whatever choice ultimately made, I'll happily convert/ start
using 1.4 and up.

To be honest I don't see the advantage of generic components, all I want is to not have to do casting when I'm using models, .getModelObject() should return the type that I put in, in a list view, if I give it a list of strings I dont want to cast the listItem model object to a string.  It would also be nice if the .add() and others methods on components could return the type of component it is rather than just a Component object.  eg you cant do 'new TextArea(...).add(some behavior).setRequired(true) because the add behaviour method returns a Component not a TextArea and setRequired is not available on Components.
 
Thanks

 « Return to Thread: users, please give us your opinion: what is your take on generics with Wicket