I am actually not using Autowiring -- I'm manually setting up the ColdSpring
file with the dependencies, but the config is being generated dynamically
for me beforehand by another application.

I'm not actually parsing an existing CFC for the dependencies, unless I'm
mis-understanding what you mean by parsing.  The CFC's will be creating
their own dependencies.

I have a generic DAO.cfc (poorly named, I know, for what I'm going to be
doing with it -- but it's all I could think of!) that includes some basic
select,save,update,delete actions.  I extend that CFC to make concrete DAO's
that represent a single table.  Looks kind of like this:

<!---
        *******************************************************************
        Created by Jonathon Stierman
        10/4/2007
        
        A descendant of Core.DAO -- this is a DAO specifically for the 
        Entities table.
        
        *******************************************************************
--->
<cfcomponent extends="Components.Core.DAO">
        <!---
        
*******************************************************************
                * Field settings
*
        
*******************************************************************
        --->
        <cfset addField(
        
CreateObject("component","Components.Core.Field").init(
                                name="entityID",
                                cfSqlType="cf_sql_integer",
                                isPrimaryKey="true"
                        )
                )
        />
        
        <cfset addField(
        
CreateObject("component","Components.Core.Field").init(
                                name="name",
                                cfSqlType="cf_sql_varchar"
                        )
                )
        />

        <!---
        
*******************************************************************
                * Relationships
*
        
*******************************************************************
        --->
        <cfset addRelationship(
        
CreateObject("Component","Components.Core.OneToManyRelationship").init(
                                table="Versions",
                                key="versionID"
                        )
                )
        />
</cfcomponent>

And then the super Core.DAO object can loop over the fields and
relationships I've added to perform CRUD methods.  It's not so much parsing
the CFC as it is using the data that the CFC stores about itself.

The problem I ran in to was that ColdSpring looks for a set****** method in
the CFC for any dependencies (which I want to be handled by the
addRelationship method).  I don't want to have to manually create the
set****** methods, because my Relationship objects contain all the data I
should need to do this for me.

Jonathon 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade to ColdFusion 8 and integrate with Adobe Flex
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291838
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to