Ok, great stuff, now we're getting somewhere.  So, the model = the 
nouns.  Good.  That helps.  Now, how do you represent in the model a 
complex query that joins across 5 of the nouns?  For example, our app is a 
network monitoring and display tool.  It receives status messages from 
sites nationwide, and makes a web interface.  (It does other things but 
this will do for now).  One of the reports we run is called "stale 
watches", which basically means "we expected to receive a message from site 
Foo reporting on the status of Bar (say, CPU Load), and we didn't hear from 
them."  We call this a stale watch.  We have a report that shows all of the 
currently stale watches across our network.  The query is a join of around 
4 tables (or nouns) - Site, Watch, Watch Config, Message - something along 
those lines.

Does one create a model object called StaleWatchReport?  That seems to me 
to be suspiciously like an action by another name.  But that's the only way 
I can see this thing working, because otherwise, the Controller is going to 
get in the business of defining what a StaleWatchReport means and start 
having to deal with DBI record sets.  I can't quite imagine what this 
StaleWatchReport would look like.

In your concert example, if I wanted to define a report that showed me all 
of the seats that were purchased by people from New Jersey with a 
Mastercard in the last week, how would I represent that?

I guess what I am getting at is that I see how if I wanted to present 
someone with the list of Sites, or even the list of Sites that met some 
criteria (newer than one month old, or whatever), I could have a Site 
object in the model that had a getSiteList() method that took an optional 
date range or whatever.  But I get lost when trying to figure out how 
result sets that are the result of a join or relationship between "noun"s 
would be represented.

I hope that makes sense. =)

-Fran

Reply via email to