Sorry, I wasn't clear. In my last example, the DAO.read(id) *does* create a BO (or TO or whatever you choose) and returns it to the Manager.

And this fits with my preference of C to answer your original question.

Caller calls BOManager.getBO(id)
BOManager checks its pool and has a couple of options:

- Return the existing BO from the pool
- Call DAO.read(id)
- If the DAO returns a BO, the Manager can replace an existing BO in its pool with the one returned from the DAO and return it
- If the DAO returns a TO, the Manager can reset and populate an existing BO from the pool with the data in the TO, or it can instantiate a new BO and populate from the TO, then replace an existing BO from the pool and return it


In none of these cases does the BO to be populated need to be passed to the DAO, and the DAO doesn't have to know anything but the database and the BO (or TO) it's populating

Christopher Bradford

----- Original Message ----- From: "Mark Mandel" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, April 07, 2005 10:21 PM
Subject: Re: [CFCDev] DAO Pattern quickie



Well yes - that would be the ultimate expression - but I was asking on a DAO level, not on a Manager level.

You asked me why I dind't like creating a Business Object in a DAO.. so I
gave you a reason.. and now, here we are back at the beginning :o)

Mark

On Apr 8, 2005 12:55 PM, Christopher Bradford <
[EMAIL PROTECTED]> wrote:

In this sort of situation, it seems that retrieving a BO directly from a DAO doesn't make sense, anyway.

Instead of BO = DAO.get(ID) or any such variant, you would use:

BO = BOManager.get(ID)

If the the Manager needs to get it from the DAO, the manager then calls
DAO.read(id) and gets back whatever it needs, whether that's a TO or a BO
and the Manager returns the BO to the caller. After alll, that's what a
Manager is for.

Christopher Bradford



-- E: [EMAIL PROTECTED] W: www.compoundtheory.com <http://www.compoundtheory.com> ICQ: 3094740



----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.


CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.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' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]




Reply via email to