I haven't thought of a cart yet, but my gut says that the cart wouldn't
necessarily be a strict BO, it would be more of a manager, having functions
like addItem(), calcTax(), removeItem().  I would have the cart composed of
multiple items (which would be BOs in the sense I am suggesting).  Then when
the user checks out, I would call the cartDAO.checkOut() and pass it the
whole cart.  The cartDAO would know how to decompose the cart and validate
it.  Does that make sense....I am pretty green but I started with much of
what Sean has provided on his site.  

Justin

-----Original Message-----
From: Gabriel Roffman [mailto:[EMAIL PROTECTED]
Sent: Monday, December 08, 2003 10:40 AM
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