I can see what is being sought after here, just not sure if it's really the best way,

So instead of your managed cfc having to have constructor args, and accessors for every thing, you only need to pass it an instance of a serviceFactory.  The main issue I see here is similar to duct typing, you will need to have better documentation as to exactly what the managed component needs to have available from the serviceFactory.  This methodology would require a bit more in the way of documentation that duct typing though.





Best Regards,

Adam Crump
Sr. Analyst - Programmer
Web Services - ICS
Amkor Technology




Sent by: [email protected]
Jared Rypka-Hauer <[EMAIL PROTECTED]>

03/09/2006 02:28 PM

Please respond to coldspring-dev


To:
<[email protected]>
cc:
bcc:
Subject:
[coldspring-dev] help




Incidentally, I've run into the same issue with how I do my MG apps... I've wanted the Factory available within a service when the Controller only has a wrapper method for it. I've wanted to inject the factory into the service so it could use it to get to DAOs.

I think, however, that this would be somewhat solved by using the autowire controller for MG.

Just a thought...

J

------------------------------------------------
Jared C. Rypka-Hauer
Continuum Media Group LLC
http://www.web-relevant.com
Member, Team Macromedia - ColdFusion

"That which does not kill me makes me stranger." - Yonah Schmeidler


On Mar 9, 2006, at 3:09 PM, Paul Roe 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