Thanks Jared,
I had a whole email typed up ready to take this issue over the to MG
list but you answered my questions before I got a chance to send.
Thanks.
On 5/5/06, Jared Rypka-Hauer <[EMAIL PROTECTED]> wrote:
First off, you may want to take this over to the MG list...
it's not a ColdSpring issue.
Second of all, if you were using the MG-included DSN and
GenericCollection beans, they DID exist and you can still
use them with ColdSpring by putting XML like this in your
ColdSpring config file:
<bean id="dsn"
class="modelglue.bean.commonBeans.Datasource">
<property name="DSN"><value>myDsn</value></property>
<property
name="Username"><value>username</value></property>
<property
name="Password"><value>password</value></property>
</bean>
Then in your controller you'd call:
getModelGlue().getConfigBean("dsn") and it would call on CS
to fetch the bean populated by the above bean definition
and give you what you used to get via ChiliBeans.
Incidentally, none of the config-bean-style beans used what
I consider to be a valid constructor (init()) method
because CB never supported the constructor-arg tag... which
is part of why it was deprecated in favor of ColdSpring
(aside from being generally more robust and feature-rich)
so the above example uses property tags. Normally I'd
prefer to see it look like this:
<bean id="dsn"
class="modelglue.bean.commonBeans.Datasource">
<constructor-arg name="DSN">
<value>myDsn</value>
</constructor-arg>
<constructor-arg name="Username">
<value>username</value>
</constructor-arg>
<constructor-arg name="Password">
<value>password</value>
</constructor-arg>
</bean>
And yes, for this you'd need to at least modify the init()
method of the ModelGlue.beans.commonBeans.Datasource class
to accept the DSN, Username, and Password arguments and
then call the appropriate setters on them. This makes it an
atomic process and somewhat faster (not a big deal on a
bean like this so much, but it can make a huge different in
other situations).
And no, ModelGlue has NEVER created any of this
automagically... you're just (apparently) using beans that
Joe included because he's cool that way and happen to find
sample code on his site that allowed you to skip finding
out what it was really doing.
Not a bad thing, not at all... just time for a bit of an
upgrate to your knowledge base. ;)
Laterz,
J
On Fri, 5 May 2006 15:25:46 -04000
"Brian Billings" <[EMAIL PROTECTED]> wrote:
> I guess where I am lost is that this bean never really
> existed
> anywhere. It was created on the fly by modelglue.. I
> would just put
> the XML file in the folder and I could call it.
>
> Are you suggesting that I actually make a bean, with
> getters and
> setters and define it in the ColdSpring bean definitions?
>
> I actually kinda liked the the fact that model glue did
> all of that
> for me, since these values really werent part of my
> model, just my web
> server folder and dsn configuration.