I've been reading Streamlined Object Modeling as of late, and they would say to put
functions like these in whatever object had the (most) information to perform the
calculation. I especially like the quote on page 99 where they are talking about how
to model a peanut butter and jelly sandwich. The question? Which object of the P&JS
spreads the ingredient. is it (a) the sandwich, (b) the slice, (c) the ingredient, or
(d) the ingredient-manager. And they write:

"If you answered (d), please go back to the beginning of the book and start over. "

They choose the ingredient object - it applies itself because it knows more about
itself than the bread slice or the sandwich.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Gabriel Roffman
Sent: Monday, December 08, 2003 6:40 PM
To: [EMAIL PROTECTED]
Subject: Re: [CFCDev] Why not have DAO in BO?


Yes, but if BOs are just a package of instance data, then where would you
put functions on that instance data.  For example, if you have a shopping
cart and you want the cart to have a calculateTax() function, would
calculateTaxbe part of the BO or part of a manager of the BO?


> Hmm, lets say you wanted to initialize the objects instance data  from a
> form, or some other mechanism other than the dB?  I have gone with the
idea
> that the BOs are fairly light weight, they simply package instance data,
and
> perform very limited validation on themselves.  That way they can be
> populated in a verity of ways....form data, dB data, whatever. The DAO in
my
> apps serves as the go between for the BOs and the Persistence Mechanism.
> Does that make sense?
>
> Justin



----------------------------------------------------------
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]


----------------------------------------------------------
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