Hi Matt,

I'm kinda confused.  You said to inject the otherFunctionsDAO into the
couponsGW, but the otherFunctionsDAO is what needs to call the
couponsGW.

Here is the bean for otherFunctions defined in Coldspring.xml and the
bean for couponsGW as well..

<bean id="otherFunctionsService"
class="it.EM.model.otherFunctionsService">
        <property name="otherFunctionsDAO"><ref
bean="otherFunctionsDAO" /></property>
        <property name="otherFunctionsGW"><ref
bean="otherFunctionsGW" /></property>
</bean>
<bean id="otherFunctionsDAO" class="it.EM.model.otherFunctionsDAO">
   <property name="AppConfig"><ref bean="AppConfig" /></property>
</bean>
<bean id="otherFunctionsGW" class="it.EM.model.otherFunctionsGW">
   <property name="AppConfig"><ref bean="AppConfig" /></property>
</bean>

<bean id="CouponsService" class="it.EM.model.CouponsService">
        <property name="CouponsDAO"><ref bean="CouponsDAO" /></
property>
        <property name="CouponsGW"><ref bean="CouponsGW" /></
property>
</bean>
<bean id="CouponsDAO" class="it.EM.model.CouponsDAO">
   <property name="AppConfig"><ref bean="AppConfig" /></property>
</bean>
<bean id="CouponsGW" class="it.EM.model.CouponsGW">
   <property name="AppConfig"><ref bean="AppConfig" /></property>
</bean>

How is the injection done?  Sorry for the Newbie questions.  Having a
little fun wrapping my head around this..

Thanks in advance.

Cliff

On Feb 21, 10:50 am, Matt Quackenbush <[email protected]> wrote:
> Presumably you are managing both of these guys with ColdSpring.  Inject the
> otherFunctionsDAO into your couponsGW.  Then call in whatever manner you
> have your code setup.
>
> Here is some quickie example code.
>
> <!--- couponsGW --->
> <cffunction name="init">
>      <cfargument name="otherFunctionsDAO" required="true" />
>      <cfset variables.otherFunctionsDAO = arguments.otherFunctionsDAO />
> </cffunction>
>
> <cffunction name="foo">
>      <cfset var myCode = variables.otherFunctionsDAO.getCouponCode() />
> </cffunction>

-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

Reply via email to