Matt Raible wrote:

I don't know if we should include them - why replace something that
already works for us.


+1 on a lazy-loading displaytag - or at least a way to limit the records
fetched from a database query. There's a couple bugs about large lists
and there's also a patch
(http://sourceforge.net/tracker/index.php?func=detail&aid=872183&group_i
d=73068&atid=536616). I think this and sorting by property (even with a
decorator) should be high priorities for 1.1.


The root of the problem as I see it is representation. List provides a simple enough interface to put functionality behind, but it may be too much API. You could certainly make a lazy-loading implementation of List that reads a limited set of data from a database, but the API is pretty heavy. Having implemented the List interface before I can tell you that it's difficult to get exactly right, mainly because there are many entry points and you have to be very aware of the semantics of each operation.

Since List is a collection it supports an API that has all sorts of methods for altering and subsecting the list. This is fine, but people will expect that this means that the model that is being displayed is always a List. With the current state of the tag this is true.

I think the more correct approach is to use a display model object that has a targeted interface toward the representation that you want. People who want to do stuff in their own custom column code can reach into this model in an application-specific way (after all, their code is creating the model and passing it into displaytag).

Something like the javax.swing.TableModel might be a better approach. It is targeted toward table-oriented display. It contains a set of methods that make it possible to write lazy-loading implementations without having to support all of the List API that might make it difficult to do. Writing a SQL query model would be much easier to lazy-load this way (using the LIMIT qualifier that some databases offer, or whatever).

- Drew

--
+---------------------------------+
< Drew Davidson | OGNL Technology >
<     Professional Open Source    >
+---------------------------------+
|  Email: [EMAIL PROTECTED]          /
|    Web: http://www.ognl.org   /
|    Vox: (520) 531-1966       <
|    Fax: (520) 531-1965        \
| Mobile: (520) 405-2967         \
+---------------------------------+




------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ displaytag-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/displaytag-devel

Reply via email to