Thanks Qasim, this worked fine for me.
 
Along the lines of "good design", is it okay that my "service" objects must
know this type of information?  It seems okay, and I can see where I'll need
to use this same type of path in other parts of my code... but I just want
to make sure I'm not proceeding with a poor design somewhere...

Thanks!!
 
Marc


  _____  

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Qasim Rasheed
Sent: Thursday, March 22, 2007 9:11 PM
To: [email protected]
Subject: Re: [Reactor for CF] Problem after switching to proper typing


I would suggest putting the return type as "reactor.base.AbstractGateway".

Thanks


On 3/22/07, Bob Silverberg <  <mailto:[EMAIL PROTECTED]>
[EMAIL PROTECTED]> wrote: 

Hi Marc,

This is a shot in the dark, but do you need a prefix on your type?  In your 
argument for setNewsletterGateway() function, you have:

<cfargument name="newsletterGateway" type="newsletterGateway"
required="true" />

But is that a valid path to the cfc?  Does it need to be 
data.newsletterGateway, or something like that?

Cheers,
Bob


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:
<mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED] On
Behalf Of Marc
Sent: March 22, 2007 2:03 PM
To: [email protected]
Subject: [Reactor for CF] Problem after switching to proper typing 


Hi Everyone,

When I started building my app, I had been using returnType="any" on all my
functions, and type="any" for all my cfarguments.

I recently refactored my code, changing it so that I'm using proper typing. 
So, of course, something had to break.  I am using CFMX6.1 with ColdSpring
and the latest Reactor code.

Here is my ColdSpring configuration (abbreviated to just the beans with the
problem):

        <bean id="newsletterService" class=" model.NewsletterService">
                <property name="reactorFactory">
                        <ref bean="reactorFactory" />
                </property>
                <property name="newsletterGateway"> 
                        <ref bean="newsletterGateway" />
                </property>
                <property name="newsletterDAO">
                        <ref bean="newsletterDAO" /> 
                </property>
        </bean>


        <bean id="newsletterGateway" factory-bean="reactorFactory"
factory-method="createGateway">
                <constructor-arg name="objectAlias"> 
                        <value>newsletter</value>
                </constructor-arg>
        </bean>


        <bean id="newsletterDAO" factory-bean="reactorFactory" 
factory-method="createDAO">
                <constructor-arg name="objectAlias">
                        <value>newsletter</value>
                </constructor-arg> 
        </bean>


Here is my Reactor configuration:

        <reactor>

                <objects>

                        <object name="newsletter" alias="newsletter" /> 


                </objects>

        </reactor>


Here is the coldspring-related functions in my NewsletterService.cfc:

        <cffunction name="getReactorFactory" access="public" 
returnType="ReactorFactory" output="false" roles="" hint="">
                <cfreturn variables.instance.reactorFactory />
        </cffunction>


        <cffunction name="setReactorFactory" returntype="void"
access="public" output="false">
                <cfargument name="reactorFactory" type="any" required="true"

/>
                <cfset variables.instance.reactorFactory =
arguments.reactorFactory />
        </cffunction>


        <cffunction name="getNewsletterGateway"
returntype="newsletterGateway" access="public" output="false"> 
                <cfreturn variables.instance.newsletterGateway />
        </cffunction>


        <cffunction name="setNewsletterGateway" returntype="void"
access="public" output="false"> 
                <cfargument name="newsletterGateway"
type="newsletterGateway" required="true" />
                <cfset variables.instance.newsletterGateway =
arguments.newsletterGateway />
        </cffunction>


        <cffunction name="setNewsletterDAO" returntype="void"
access="public" output="false">
                <cfargument name="newsletterDAO" type="any" required="true" 
/>
                <cfset variables.instance.newsletterDAO =
arguments.newsletterDAO />
        </cffunction>


And here is my beautiful new error:

The argument NEWSLETTERGATEWAY passed to function setNewsletterGateway() is 
not of type newsletterGateway. If the component name is specified as a type
of this argument, the reason for this error might be that a definition file
for such component cannot be found or is not accessible.

The error occurred in {snipped}\NewsletterService.cfc: line 71


Line 71 is the setNewsletterGateway function.

The table in the database is named "Newsletter".

Can anyone tell me what I've done wrong? 







-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- Reactor for ColdFusion Mailing List [email protected] Archives 
at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --







-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --






-- 
Qasim Rasheed
Certified Advance ColdFusion MX Developer
(IM qasimrasheed AT yahoo, msn or GTalk) 
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --



-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to