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
----- Original Message ----- From: "Mark Mandel" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, April 07, 2005 8:40 PM
Subject: Re: [CFCDev] DAO Pattern quickie
Yeah I would... assuming we have some sort of persistance layer -
The Manager would: - Check to see if the BO required is in the Pool, if yes, return it. - otherwise createEmptyBO (from a Factory, or on it's own, dependent on how abstract you really wanted to be) - Then pass the BO to the DAO to populate it's data (assuming option (b)) along with the ID of the BO you want - Return back out the BO
In this model, the DAO knows about the BO's methods, and how that relates to the database. Nothing more.
But like i said - it's just one interpretation.
Mark
On Apr 8, 2005 11:29 AM, Christopher Bradford < [EMAIL PROTECTED]> wrote:
In that case, would you object to the DAO getting the BO from the Manager?
Christopher Bradford
---------------------------------------------------------- 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]
