Just to add a little clarification, incase anyone didn't quite get
what Dave wrote. The init-method attribute in a bean allows you to
define a method to be called post-dependency injection method, so you
can preform some final setup on your cfcs before they are returned
from the bean-factory. Completely unrelated to the the method 'init'
that we in cf have taken to use as a constructor, called right after
the cfc is created, which is also what you can define constructor-
args for. Personally, I never really use constructor-args. I prefer
to use setter-injection over constructor-injection and use an init-
method to setup my cfcs state if needed.
On Nov 8, 2005, at 9:10 PM, Dave Ross wrote:
as Paul said, you're spot on, but I thought I'd mention the
init-method attribute since it probably relates:
When you specify an init-method on a <bean/> tag, ColdSpring will call
the specified method after all of the CFC's dependencies have been
resolved. This means you can use <property/> and setter methods and
still have a chance to execute some arbitrary code before anything
else happens. Oddly, in the java world, people use "init" as their
init-method name, e.g. <bean ... init-method="init" />, which probably
isn't a good idea since our constructors are named init :) We usually
use "setup" instead...
-Dave
On 11/8/05, Peter J. Farrell <[EMAIL PROTECTED]> wrote:
Just wanted to confirm that:
<property...>'s are set after the init() is performed on a bean
definition
<constructor-arg..>'s are passed into the init() of the bean
definition
Is that correct?
--
Peter J. Farrell :: Maestro Publishing
http://blog.maestropublishing.com
Rooibos Generator - Version 2.1
Create boilerplate beans and transfer objects for ColdFusion for
free!
http://rooibos.maestropublishing.com/
Member Team Mach-II - It's coming...we're in a code freeze!
--
Paul Kenney
[EMAIL PROTECTED]
[EMAIL PROTECTED]
http://www.pjk.us