Ed,
I took a brief look and created a simple example.

I created a "gov" folder in my webroot.  I have an index.cfm in there with
this code:

<cfset foo = createobject("component",
"gov.epa.rtp.onlinetraining.trainee.trainee") />

<cfset fooDao = createobject("component",
"gov.epa.rtp.onlinetraining.trainee.traineeDao") />

<cfdump var="#foo#">
<br />
<cfset fooDao.update(foo) />
<br />
<cfdump var="#foo#">

So, we are in "gov".  In the gov/epa/rtp/land/ folder, there is a file
called bean.cfc.  It has nothing in it. (will explain shortly)

So, let's go back to root of "gov".  In the
gov/epa/rtp/onlinetraining/trainee/ folder.  I have two files of trainee.cfc
and traineedao.cfc.

Trainee.cfc has this:

<cfcomponent extends="gov.epa.rtp.lang.bean">

    <cfproperty name="firstName" type="string" default="" />
    <cfproperty name="lastName" type="string" default="" />

    <cfscript>
    this.firstName = "";
    this.lastName = "";
    </cfscript>

</cfcomponent>

TraineeDao.cfc has this:

<cfcomponent>


    <cffunction name="update"
                output="false"
                returnType="void">

        <cfargument name="trainee"
                type="gov.epa.rtp.OnlineTraining.Trainee.Trainee"
                required="true"
                hint="Trainee Bean" />

        <cfset arguments.trainee.firstName = "Teddy" />

    </cffunction>

</cfcomponent>

So, notice the extends path on trainee.cfc.  The cfdumps from the index.cfm
will show if the extends is present regardless of the content.

A point of note, your DAO doesn't have to return anything as traditionally
you are modifying the bean that is passed and that bean will have the
updated values after the fact as the demo shows.

Plus, this code piece here:

<cfargument name="trainee"
                type="gov.epa.rtp.OnlineTraining.Trainee.Trainee"
                required="true"
                hint="Trainee Bean" />

This is good to show pathing to your trainee bean object, but Trainee.cfc
and TraineeDao.cfc are in the same folder.  So, you could have:

<cfargument name="trainee"
                type="Trainee"
                required="true"
                hint="Trainee Bean" />

The full path is handy in the fact that you force yourself to code with the
exact location of your beans and you have to update the path if you change
where your beans reside.  From a Flex perspective, this is good to have the
full path as this assists in aliasing into creating custom data types by
aliasing valueobjects to coldfusion CFC(s).

I hope that helped,
Teddy

Reply via email to