I've read and reread Sean's Mach II article example and am trying to
implement it now.  However, my natural inclination is to have the DAO object
be part of the business object?  In the init method of the BO, I would call
the read method of the DAO.  So my init method of the BO would look
something like this...

<cffunction name="init">
    <cfargument name="objID" type="numeric" default="0" required="false">
    <cfset var instance = structNew()>
 <cfset instance.ID=0>
 <cfset instance.name="default name">
 <cfif val(objID) GT 0>
  <cfset data = DAO.read(arguments.objID)>
  <cfset instance.ID = data.ID>
  <cfset instance.name = data.name>
 </cfif>
 <cfreturn this>
</cffunction>

What do you see as pitfalls of having the DAO be inside the business object
like this?

Gabe Roffman

www.etesters.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]

Reply via email to