So your saying that the way that Mach-ii listeners use coldspring is incorrect, because I was under the understanding that most mach-ii'ers use the plugin that comes with this framwork. In my case I am essentially building a listener and I NEED access to the factory so that I can retrieve my DGO. Since I am not using the coldspring factory in any different way than the mach-ii guys are I fail to see how you can say I'm trying to use in an incorrect manner.

This still doesn't negate the fact that in order to use coldspring in the same manner that mach-ii uses it I will have to manually pass the coldspring factory into my service rather than just specifying that the service requires a coldspring factory as an argument and allowing coldspring to pass itself into my service/listener.

On 3/9/06, Chris Stoner <[EMAIL PROTECTED]> wrote:
Your business unit shouldn't know about cold spring.  If there is something your business unit needs have coldspring pass it in.  That's what coldspring is for.  The autowiring that mach-ii does is for populating objects which are not managed by coldspring with objects that are.




On 3/9/06, Paul Roe <[EMAIL PROTECTED] > wrote:
FYI I am not using Mach-ii that was just an example of how I want to use the factory.

On 3/9/06, Paul Roe < [EMAIL PROTECTED] > wrote:
no sorry, I must be badly misrepresenting what I'm trying to do.

From inside my BusinessUnit Service I want to be able to call the coldspring factory, and I would like
the coldspring factory to be provided to as a constructor-arg to the BusinessUnit service. 

In mach-ii they manually retrieve the coldspring factory like this:
<cffunction name="configure" access="public" returntype="void" output="false">
        <cfset var sf = getProperty('serviceFactory')/>
        <cfset variables.m_categoryService = sf.getBean('categoryService')/>
    </cffunction>

But I don't see why I can't have coldspring pass itself into my BusinessUnit Service.



On 3/9/06, Chris Scott <[EMAIL PROTECTED] > wrote:
Paul, I'm not sure if you're missing the point, ColdSpring will
automatically provide managed CFCs with there dependencies, via
setter methods or constructor args. Just register the two components
and tell it you want the BusinessUnitDGO component to be provided to
the BusinessUnit component:

-services.xml
<bean id="businessUnitDGO" class="BusinessUnitDGO" />

<bean id="businessUnit" class="BusinessUnit">
    <constructor-arg name="businessUnitDGO">
        <ref bean="businessUnitDGO" />
    </constructor-arg>
</bean>

OR

-services.xml
<bean id="businessUnitDGO" class="BusinessUnitDGO" />

<bean id="businessUnit" class="BusinessUnit">
    <property name="businessUnitDGO">
        <ref bean="businessUnitDGO" />
    </property>
</bean>




On Mar 9, 2006, at 3:40 PM, Peter J. Farrell wrote:

> Paul Roe said the following on 3/9/2006 2:04 PM:
>> sorry I wasn't clear, I want the csFactory to be the actual
>> coldspring
>> factory object that will be using the xml file
>>
>> so when I create the factory:
>> <cfset application.csFactory = createObject("component","
>> SCAR.coldspring.beans.DefaultXmlBeanFactory").init() />
>>
>> I  want this application.csFactory object to be passed into some of
>> the services that it will create.
> I don't know if that's the best idea.  Why can't you let CS inject the
> required dependencies into your factory?
>
> .Peter
>
> --
> Peter J. Farrell :: Maestro Publishing
> Member Team Mach-II :: Member Team Fusion
> http://blog.maestropublishing.com
>
> Create boilerplate beans and transfer objects for ColdFusion!
> Fire up a cup of Rooibos!
> http://rooibos.maestropublishing.com/
>
>
>






Reply via email to