On 10/23/07, Jonathon Stierman <[EMAIL PROTECTED]> wrote:
>
> 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.
>
> <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"
>                         )
>                 )
>         />


Transfer and Reactor will let you define these fields in the XML and will
create DAO functionality (CRUD) for you.

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


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.


Two problems here. First, you can use constructor injection instead of
setter injection, so you don't have to have setters. Second, you seem to be
calling a database relationship a "dependency", which I'd say isn't
accurate. The dependencies that ColdSpring resolves don't have anything to
do with the database (my SecurityService might need a reference to the
UserService to do it's work. ColdSpring will resolve this dependency and
clearly it has nothing to do with database relationships). When it comes to
dealing with database relationships, again, Reactor or Transfer will do most
of this for you.

Jonathon
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get involved in the latest ColdFusion discussions, product
development sharing, and articles on the Adobe Labs wiki.
http://labs/adobe.com/wiki/index.php/ColdFusion_8

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291851
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