Mach-ii listeners are NOT part of an application's model, and are NOT
managed by ColdSpring, thus they need access to the BeanFactory so
they can retrieve and use pieces of the model.

Your BusinessUnitService IS part of your model and IS managed by
ColdSpring, thus there is no reason that it needs access to the
BeanFactory. As others have suggested. use ColdSpring to supply it
with it's dependencies (that's what ColdSpring is for!).

Hope that helps!

-Dave

On 3/9/06, Paul Roe <[EMAIL PROTECTED]> wrote:
> 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