There is if you use ColdSpring to create a config bean for Reactor and pass
that into the Reactor object using ColdSpring. You just call getBean() for
the Reactor config object. However, we're still at the question of why, in a
new application, there would be any reason for anything outside of Reactor
to know or care what the DSN name is.
On 7/9/07, Leon Chalnick <[EMAIL PROTECTED]> wrote:
Howdy,
I'm working on my first Model-Glue: Unity app and am wondering about the
best way to configure my beans with a datasource name. I'm hoping someone
on
this list has experience with Model-Glue's implementation of CS and can
point me in the right direction.
<bean id="contact" class="MGcontactMgr.model.contact">
<constructor-arg name="dsn"><value>ows</value></constructor-arg>
</bean>
<bean id="contactGateway" class="MGcontactMgr.model.contactGateway">
<constructor-arg name="dsn"><value>ows</value></constructor-arg>
</bean>
I have the dsn already defined in my reactorConfiguration bean (below),
seems rather clumsy to have to spell it out again this way.
<bean id="reactorConfiguration" class="reactor.config.config">
<constructor-arg name="pathToConfigXml">
<value>/MGcontactMgr/config/Reactor.xml</value>
</constructor-arg>
<property name="dsn"><value>myContactMgr</value></property>
...
</bean>
So my first question is...I'm sure there's a more elegant way to pull the
dsn property from the reactorConfiguration bean and pass it to my other
beans, yes?
Second...is this the appropriate place to be passing the dsn to beans that
will interact with the database? Seems like a better place to do it than
in
my controller.cfc...
TIA!
--Leon