Re: Unfriendly Model.ofList etc. methods; can anything be done?

2011-02-13 Thread Willis Blackburn
On Feb 13, 2011, at 2:33 PM, jer...@wickettraining.com [via Apache Wicket] wrote: > I understood your key point, which is why I said "as a side note" but my > point still remains. Loading a list and then sticking it into Model class > is in almost all cases a *bad* idea. I agree with y

Re: Unfriendly Model.ofList etc. methods; can anything be done?

2011-02-13 Thread Scott Swank
A simpler API would be: public static IModel> ofList(final List list) or even: public static IModel> ofList(final List list) since you are calling this method with a specific List, and hence the type of the List is known. Scott On Sun, Feb 13, 2011 at 11:32 AM, Jeremy Thomerson wrote: > O

Re: Unfriendly Model.ofList etc. methods; can anything be done?

2011-02-13 Thread Jeremy Thomerson
On Sat, Feb 12, 2011 at 8:49 AM, Willis Blackburn wrote: > jer...@wickettraining.com wrote: > > > > On Sat, Feb 12, 2011 at 7:56 AM, Willis Blackburn > > wrote: > > > > As a side note, rarely should you ever use Model class for a list of > > things, > > especially things loaded from a database.

Re: Unfriendly Model.ofList etc. methods; can anything be done?

2011-02-12 Thread Willis Blackburn
jer...@wickettraining.com wrote: > > On Sat, Feb 12, 2011 at 7:56 AM, Willis Blackburn > wrote: > > As a side note, rarely should you ever use Model class for a list of > things, > especially things loaded from a database. If you then pass that model to > a > component, all the things in it w

Re: Unfriendly Model.ofList etc. methods; can anything be done?

2011-02-12 Thread Jeremy Thomerson
On Sat, Feb 12, 2011 at 7:56 AM, Willis Blackburn wrote: > > I'm constantly running into problems with this method: > > public static IModel> ofList(final List > list) > > This says that ofList takes, as a parameter, a List of C or some subclass > of > C, and returns a List of C or of some subcl

Unfriendly Model.ofList etc. methods; can anything be done?

2011-02-12 Thread Willis Blackburn
I'm constantly running into problems with this method: public static IModel> ofList(final List list) This says that ofList takes, as a parameter, a List of C or some subclass of C, and returns a List of C or of some subclass of C. The problem that I keep having is that the type of the input li