Hi everyone,

I am quite new in applying OOD/P to CF via implementing cfcs. So here is my
problem:

I have a CFC called Order.cfc.
Within this CFC I create several DAO Objects (e.g. for related customers
instantiating the CustomerDAO.cfc)
So far so good.
Now I want all the SQL stuff from the Order.cfc out of it and put it to
OrderDAO.cfc.
So I created a new property of the Order.cfc by instantiating the
OrderDAO.cfc through the init-Method of the Order.cfc:
<cfset this.oOrderDAO  = createObject("component","OrderDAO").init() />

By the getter-Method in the Order.cfc I can get access to these DAO-Objects.
        <cffunction name="getOrderDAO" output="false" returntype="struct">
                <cfreturn this.oOrderDAO/>
        </cffunction>

Now I want to set my properties (all the variables in the this-scope) via
calling the method selectOrders() and calling the mother's method in
Order.cfc named setOrdersByStruct(queryResult) in the OrderDAO.cfc using
super.setVertragByStruct()

        <cffunction access="public" name="selectVertrag" output="true">
                <cfargument name="iVertragID" type="numeric"
required="true"/>
                        <cfquery name="variables.qSelectVertrag" 
                                        datasource="#this.sDsn#">
                        SELECT 
                                *
                        FROM 
                                Order
                        WHERE 
                                pk_Order = #val(arguments.iOrderID)#
                        </cfquery>
                        <cfset
super.setVertragByStruct(variables.qSelectVertrag, "query")/>
                        
        </cffunction>

An other issue is that I need to get the properties (through the
getter-Methods) of the mother's cfc in the child CFC. As I know I cannot get
direct access to the this-scope in the mother CFC, so the getter-Method
fails.

How can I do apply the DAO-Pattern correctly? I heard something of a
Transfer Object that may be the golden key to solve this problem. Can
anybody explain this to me please?

Great thanks in advance for any help. I am looking forward to your replies.


Magnus Wege

____________________________________________
web-shuttle AG | Tel +49 89 130 145-0
Wilhelm-Hale-Str. 53 | Fax +49 89 130 145-10 
D-80639 Munich | Germany



----------------------------------------------------------
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 
[EMAIL PROTECTED]

Reply via email to