users@glassfish.java.net

Re: Limiting ammount of Data JPA pulls from Database

From: <glassfish_at_javadesktop.org>
Date: Sat, 10 Nov 2007 11:25:13 PST

> One could simply argue that the domain model does not
> change, but rather the implementations of the
> internal constructs change.

I've played both sides of this game. I guess what I'm musing on is: does "paging" (for want of a better term) constitute purely an implementation detail, or is it significant enough to warrant consideration inside the domain model? One could argue the flip side of your position: write a cover method, order.getOrderLines(), that delegates to order.getOrderLines(0, Integer.MAX_VALUE).

I really don't have an opinion yet, and the usual annoying disclaimer about how this will change depending on your requirements etc. still holds, but I've never really seen people discuss paging as anything other than a slap-on UI-driven infrastructure need--and I'm wondering if instead it shouldn't get some first-class love at the domain level. The thought would be something like this: look, deciding how many chunks to retrieve is something that callers really should be thinking about all the time. It isn't tied to a particular technology. For these reasons, the logic would go, make sure every layer down the stack can expose paging as a first-class concern.

I don't know whether I buy that or not; my jury's still out. Anyhow, I thought it would be interesting to see if others have thoughts on this subject--thanks for chiming in!

Cheers,
Laird
[Message sent by forum member 'ljnelson' (ljnelson)]

http://forums.java.net/jive/thread.jspa?messageID=244899