I see now what both Brian & Mark mean... makes sense.
For me I've only just started using coldspring, so I've basically
followed the doco on the Coldspring site... as for user case... I
think I won't it down on the back of a leaf... *lol* I'm pretty much
winging it at the moment.
For example...
I have a few cfcs that do some logic. ContentBean.cfc
I have a cfc with configy stuff (setting/getting datasource).
ConfigBean.cfc
And I have a gateway cfc for any queries. ContentGateway.cfc
Assuming then you kinda understand what my ConfigBean is doing...
getter & setter for datasource...
Coldspring.xml is something like...
<bean id="ConfigBean" class="dodgy.ConfigBean">
<constructor-arg name="datasource">
<value>${datasource}</value>
</constructor-arg>
</bean>
<bean id="ParentBean" abstract="true">
<property name="ConfigBean">
<ref bean="ConfigBean" />
</property>
</bean>
<bean id="ContentsGateway" parent="ParentBean"
class="dodgy.ContentsGateway" />
In my Gateway file I would have function like...
<cffunction name="getSomethingUseful" ...>
<cfquery name="usefulName" datasource="#getConfigBean().getDatasource
()#">
...
</cfquery>
</cffunction>
Is this wrong?
As for loading into application scope... is there a problem here? At
the moment I'm using fusebox framework, which also loads into
application scope. I had a reason for doing this, but can't remember
exactly why... I figure if there's no "big" issue with loading it in
application, then there's no reason why not to.
Hopefully I'm on the same track as Phil on this... and not off topic. :
$
- Joey
On Oct 13, 4:25 pm, Mark Mandel <
mark.man...@gmail.com> wrote:
> I have to echo Brian on this one.
>
> What is the use case for this anyway? I'm failing to see what benefit you
> are gaining?
>
> Mark
>
>
>
>
>
> On Tue, Oct 13, 2009 at 4:19 PM, Brian Kotek <
brian...@gmail.com> wrote:
> > I doubt there would be any technical problem with doing it, I just don't
> > see what sense it makes from a design perspective. Is there some specific
> > reason that you prefer this instead of just autowiring the proper beans into
> > the objects that need them? Isn't this just a ColdSpring-specific take on
> > global variables, with all of the baggage that brings along with it?
>
> E:
mark.man...@gmail.com