Fran

> Out of these two, I would think that the first one is actually
> better.  What if you have 300,000 watches and only 25 are stale, for
> example (numbers that are not all that far from the truth, in my
> case)?   That'd be a lot of data I'd be slinging around in the 2nd
> example.  Which is probably what you meant by "might be better". :-)

Jeff's example was very abbreviated to make a point.  In your case, you 
should think about two things:  
1) the representation of your data
2) the fetching of your data

Since you could have a zillion watches, you could use something like

my $staleWatches = WatchManager::watchesWithStatus("stale");

This allows you to implement the "watchesWithStatus" method any way you 
choose, and simply returning an arrayref of matching watches.  Then you 
can pass that arrayref to your View, which, as Jeff says, should apply 
some transform to your data to produce your report.    I realise this 
is essentially what Jeff is saying but the key point is that you don't 
need to have all 300,000 watches in memory... you can abstract the data 
using a Manager (or Broker, or... ) so you hide the data store.

Cheers

Kyle Dawkins
Central Park Software

Reply via email to