Bill Rawlinson wrote:
Student is a pretty complex object storing a bunch of stuff, including a GradeLevel (showing if they are a freshman, sophmore, junior, or senior). GradeLevel is basically just an id/name pair.
However, the school that these Students attend is being changed from a four year school to a three year school so the "freshman" GradeLevel (id=1) has to be deleted. Before the actual grade level can be deleted the references to that gradelevel has to be removed from the studenttable (foriegn key constraints and all that).
Lets pretend for a moment that a student CAN be allowed to not have a GradeLevel value and so we want to just set the GradeLevelID of all students with a GradeLevelID of 1 to NULL
It seems like even if you could have a null value, it would only be temporary. I probably wouldn't model this at all, and just run a one-time query against the app.
If there was some ongoing business rule with regards to null GradeLevels under certain conditions, I'd probably put the code in GradeLevel or Student, then persist it with the DAOs. I guess if you have to periodically set a bunch of student's gradelevel's to null, I'd probably put that in the GradeLevelGateway.
now the query for this is pretty easy - but where does the query go: 1. StudentGateway 2. GradeLevelGateway 3. GradeLevelDAO
where would you put it?
Thanks Bill
--
***********************
Chris Dempsey
Director, Information Services
UCSB Graduate Division
Abutebaris modo subjunctivo denuo
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
