You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Lauri Piispanen <la...@conmio.com> on 2008/08/20 10:54:28 UTC

Re: generics


igor.vaynberg wrote:
> 
> so now you have to do new
> DataView<Void,Foo> which is very noisy not to mention you have to
> remember which one is for the model and which one is for the
> dataprovider.
> 
> -igor
> 
> 

I don't know if this is too late, and haven't played with DataViews for a
while but why couldn't you do something to this extent:

public abstract class DataViewBase<T> extends AbstractPageableView<T>
{

	public <K> DataViewBase(String id, IDataProvider<K> dataProvider)
	{
		...snip...
	}

		...snip...

	private static final class ModelIterator<K> implements Iterator<IModel<K>>
	{
		...snip...
	}

}


as DataView's children aren't actually supposed to use T - that's what the
DataView's model would use but chooses to ignore it (and we can't know if
some subclass would actually _want_ to use the model for something). Just
drop the T parameter and avoid the noise if required.
-- 
View this message in context: http://www.nabble.com/generics-tp18083910p19065291.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