Eelco Hillenius wrote:
> 
>    [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.
> 

We are on 1.4 trunk on a huge project (> 100k LOC) which we are still in the
middle of converting as we started out on 1.3.x. I can say without a doubt
that generic components do get in the way, and that there are only a few
cases where we actually call getModelObject(), for which casting is an
acceptable workaround.

I would go so far as saying, the concept of 1:1 Model:Component can be
misleading. As a number of previous posters have indicated, and I can
validate first-hand, most components are not model backed. In my case, and I
even have a few components that are backed by more than one model. So
another angle to consider is completely decoupling Model from Component.
Instead you might have setModel(String id, IModel<?>) and getModel(String
id)... The old getModel() would be the equivalent of calling
getModel((String)null)... I understand that this is a huge API break, with
marginal value, but it does express the Model:Component relationship a lot
more clearly.





-- 
View this message in context: 
http://www.nabble.com/users%2C-please-give-us-your-opinion%3A-what-is-your-take-on-generics-with-Wicket-tp17589984p17628984.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to