hrm.,  No sorry I guess I generalized too much.  It isn't a situation
I am facing specifically - and that is why my contrived example didn't
really convey my question I guess.

So I will try a different, but still simple, scenario.

Lets presume we have a Worker and a Certification 
a Worker can have a Certification associated with them - however,
sometimes Certifications expire and are deleted as they are no longer
even remotely valid.

So when the certification is deleted - would you, as Chris suggested,
just delete all the references inside the CertificationDAO? Or would
you do this somewhere else?

I run into situations all the time where a object can optionally
reference another object and that referenced object can still be
deleted (so long as the references are deleted as well)

So now, within my object model when I run into this in the future I
just wonder where it would be best practice to put that added query.

My initial feeling has been to have it in the DAO for the referenced
object (Certification, GradeLevel, whatever)- but the "textbook"
definition of DAO I keep seeing is that they only effect one row in
the table.

Should I for consistency sake between how DAOs are expected to behave
pull that reference clearing query out of the referenced object DAO or
- since it is a steadfast data layer rule have it in the DAO?

Hope this helps and thanks again for your feedback
Bill




On Tue, 25 Jan 2005 18:53:09 -0500, Patrick McElhaney
<[EMAIL PROTECTED]> wrote:
> This may sound oversimplistic, but I would have the application make
> sure that that no students are freshmen before deleting the freshman
> object.
> 
> That may mean looping over all of the freshman objects and promoting
> them to sophomores, deleting them, or (ack!) removing their class
> affiliation. There may be different strategies for handling different
> students. (Promote the A students and drop the rest.) Or it may mean
> disabling the delete button on the freshman form.
> 
> Of course there plenty of other ways you could handle it. But that's a
> decision for your customer to make.
> 
> I wouldn't have the gateway try to fix the problem itself.
> 
> Patrick
> 
> --
> Patrick McElhaney
> 704.560.9117
> http://pmcelhaney.blogspot.com
> ----------------------------------------------------------
> 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]
> 


-- 
[EMAIL PROTECTED]
http://blog.rawlinson.us

I have 9 gmail invites,want one?
----------------------------------------------------------
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]

Reply via email to