users@glassfish.java.net

Re: Limiting ammount of Data JPA pulls from Database

From: <glassfish_at_javadesktop.org>
Date: Sat, 10 Nov 2007 10:31:42 PST

> This is a contrived example because you would
> hopefully never make an Order that was so big that
> paging would actually be a concern, but you see what
> I mean.
>
> Less contrived: What about other areas of an
> application? System.getUsers(), for example, might
> be one of those APIs where you start out by thinking
> that your application won't be very popular, but then
> it becomes the next MySpace.
>
> So what's my point? I guess to the extent I have one
> it's just that it's easy to wave our hands and say
> "use JPA's paging facilities", but those concerns
> bubble up to the domain layer.

Yes, of course, the painful reality when purity of design meets crushing realities.

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

Using you example, you'll notice that you provide a List. Thankfully (and rightly so), List is an interface. One could suggest that internally the actual list implementation is OMGThisListIsHuge, and it manages the heartache for us.

So, in that light, we shouldn't have to compromise the domain layer.

Truth is harsher than that, of course, so many just punt.

But it doesn't necessarily have to be that way.
[Message sent by forum member 'whartung' (whartung)]

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