hi

i just read the article on 'what the hell is auto wiring' and it
really does make so much sense, thanks for the help, except only one
point that confused me a little:

i understand passing services into each cfc and understand that if a
new service is added that the problem is that we have to go into all
cfc's and add a setter function, and he does mention something at the
end of the article to do with mixin, which sounds great but i dont
quite understand exactly how to achieve this.

the quote was:

'What I've done there is move all of these "set[Something" functions
to a file called /model/mixin/applicationServices.cfm that each of my
controllers  (becoming a "static mixin"). That way, if a new service
pops up, I add a setter function to one file, and it's available in
all services! Now that's much nicer writing init() plumbing code in
specific controllers!!'

can someone provide an example of how this would work as i cannot
quite grasp exactly how i would achieve this

thanks again for your help

richard



On Sep 11, 2:57 pm, "Fernando Lopez" <[EMAIL PROTECTED]> wrote:
> Hi Richard
> I've been there and know exactly the feeling.
> The automagic steps of CS and MG can be puzzling at first
> take a look at this article and you'll have a better 
> idea.http://www.firemoss.com/post.cfm/ModelGlue--What-the-hell-is-autowiring
>
> I also recommend reading the CS documentation and paying close attention to
> the Bean definition section
>
> Good Luck
> Fernando
>
> On Thu, Sep 11, 2008 at 9:21 AM, cs01rsw <[EMAIL PROTECTED]> wrote:
>
> > hi
>
> > we have noticed on an example that the following cfc is referenced in
> > the coldsprings.xml as follows:
>
> > <bean id="ContactDAO" class="ContactManagerMG.model.ContactDAO">
> >      <property name="AppConfig"><ref bean="AppConfig" /></property>
> >    </bean>
>
> > and in the ContactDAO.cfc there is a setter:
>
> > <cffunction name="setAppConfig" access="public" output="false"
> > returntype="void">
> >    <cfargument name="AppConfig" type="any" required="true" />
> >    <cfset variables.instance.AppConfig = arguments.AppConfig />
> >  </cffunction>
>
> > however, we cannot find any code that calls the setAppConfig function,
> > and there is no init function within the ContactDAO.cfc.
>
> > this leads us to believe there must be a direct relationship between
> > the <property name="AppConfig"><ref bean="AppConfig" /></property> and
> > the setter function. when the bean is created does it automatically
> > look for a set function for that property?
>
> > we are a little confused with this and would appreciate the help. this
> > also then leads us to some confusion about when and why you use the
> > init function, and when and why do you use properties
>
> > thanks for any help
>
> > richard
--~--~---------~--~----~------------~-------~--~----~
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

For more about Model-Glue, check http://www.model-glue.com .
-~----------~----~----~----~------~----~------~--~---

Reply via email to