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


Reply via email to