> database driven webapps may use primary key, but wicket needs to be > general enough to display lists that are simply any ordered collection. > the current code works, so we need to consider all aspects of lists > and listviews to make changes. we really shouldn't restrict a general > class like ListView to one particular problem, even if it is a really > common problem. > > the reason i picked List is that i took really a reverse view of the > list view component. basically, a list view in the abstract needs to > be able to display an ordered collection of elements. the List interface > provides this naturally within the java language. the problems of a > database driven web application are perhaps outside the scope of this > most abstracted and simplest kind of listview. > > it may be that what we need to make everyone happy is a base class > that deals with the display of Lists in general with a subclass (or > unrelated class) that deals with the special problems associated > with database backed lists. > > as far as guiding people to the right thing, it could be that simply > renaming the current indexed ListView to IndexedListView and then > creating a new ListView with database-related features by default would > guide people who are looking for pk-based lists to the right place... > > we need to think very carefully about how any new list interface would > work, particularly as that relates to paging, ordering, hibernate sets > and detachable models.
1) lists are index based, most lists that webapps deal with are primary key based. The default implementation of an index based approach leads to bugs that are not always apparent when using detachable models. Good frameworks try to force users to use best practices. 2) in order to use primary keys we need to translate an object into a pk-based model. Currently this is done by overriding a method in a listview, however, this is a horizontal concern and should be separated. 3) a more concrete interface makes it a lot clearer to see what is needed. Interface ListViewDatasource { List getItems(first, count); int getTotalItemCount(); Imodel getObjectModel(Object o) } presents a much clearer picture as to what needs to be done and how listview works. Thanks, Igor ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user