Or are generic components strictly a side-effect of generic
models?

The latter imho. I've played around with it a bit, and I couldn't
really find a way to have generified models in a meaningful way
without having to generify components as well.

The main potential advantage that I see in applying generics in Wicket
would be the ability to force specific types of models for certain
components. But now take the case where you say we'll keep it minimal
and just use generic methods:

public <T> Component(final String id, final IModel<T> model)

would work, and you could define a component like:

public UserDetailsComponent(final String id, final IModel<User> object)

However, this won't help a lot as getModel would only return the raw
type, and we can't override setModel with IModel<String> either.
get/setModelObject won't work either (though as I've stated before, I
could live without those methods in the first place).

Do you have an idea that works without having to generify Component?

Eelco

Reply via email to