commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Dudziak <>
Subject Re: [collections] new sublist type?
Date Tue, 29 Nov 2005 10:49:53 GMT
On 11/29/05, Simon Kitching <> wrote:

> Note that I'm talking here about situations where the "complete" dataset
> cannot be loaded into memory due to size. Typically the data is stored
> within a database.
> The use case for this is as follows:
>  The presentation tier of an application wants to allow a user
>  to view a *large* set of available data one "page" at a time.
>  It needs to know the full size of the available data
>  The business level of the application therefore needs to be
>  able to return some collection representing a "sublist" of
>  the available data.
> In particular, I've struck this need when writing an application using
> JSF [myfaces] and EJB3. I'd like to add a generic component to the
> MyFaces library which can handle paginated data. However the "sublist"
> type returned by the EJBs shouldn't be a type from the MyFaces library;
> that would be very bad style. A "sublist" type available from the
> commons-collections library would form an excellent "bridge" between the
> two worlds (business and presentation).

I don't know anything about JSF/EJB in particular, but when for
instance I want to show a large collection in Struts, I'd use a proxy
list that maintains a 'frame' of the data of a pre-specified size
which it is able to fetch from the database.
This way, there is no need to create new functions on the view side
because it thinks it works with a normal list - e.g. c:forEach or
displaytag work without problems.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message