By using good frameworks like iBATIS (which has great support for
> pagination and dynamic queries) and design patterns pertinent to
the requirement, the code in the layers you can be kept to a minimum. The web application at workeffort.dev.java.net does all kinds of pagination, ordering sorting etc from the database. The methods for
pagination in the struts actions is a few lines and the service layer
method call is a one liner. There is no code bloat if you take the time to design the different layers appropriately.

Now that I remember, I think one of the major pain points for doing paging/sorting at the DB level with Hibernate and Struts together was needing to make a second query with "count(*)" to figure out how many total rows/pages there are. If Hibernate gave you back a paginated results object that implemented Collection (and size() works), which I think iBATIS does, it would be cleaner.


Lazy-paginated collections may require the "open session in view" pattern to actually fetch the results from within a JSP page. I'm not that fond of this personally (hangs onto db resources during potentially slow output rendering/transmission) but it seems to be the widespread accepted practice.

-- Bill
--
Bill Schneider
Chief Architect

Vecna Technologies
5004 Lehigh Rd., Suite B
College Park, MD 20740
[EMAIL PROTECTED]
t: 301-864-7253 x1140
f: 301-699-3180

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to