If we are to follow conventions that init method is treated as a constructor, I would have to disagree on the issue of ColdSpring picking up a superclass constructor by itself. This is outside of the normal behavior of object oriented language. If you would like to call the constructor for a superclass in an extended class I really think you should be calling super.init() in  the init method in the extended class. 

Just my 2 cents there...



On May 4, 2006, at 11:31 AM, Dave Ross wrote:

Ruud,
 
We've wavered on the calling init() on a superclass "debate" for a while - it sounds like people expect ColdSpring to do this - which I understand. Maybe my resistance was based on the fact that I have yet to write a CFC without an init method in my mind - concrete classes have constructors, period. This has been discussed in the past for those interested ( http://www.mail-archive.com/[email protected]/msg00206.html)
 
So I've created two tickets:
 
http://code.coldspringframework.org/browse/CSP-50 (Call inherited init() methods)
 
Please, anyone interested in these features create an account on our issue tracker and vote for them. This will give us an idea on prioritization.
 
As for your second issue - post your bean definition xml and an example setter-method constructor arg. lso are you using bleeding edge or 0.5.0?
 
thanks,
 
Dave

 
On 5/4/06, Ruud Hermans <[EMAIL PROTECTED]> wrote:
Hi there,

For a while now, I'm using coldsping & machII in my app, which uses a
standard (= non application specific) AuthenticationService.cfc to do
all its authentication stuff. Works like a charm.
However, today I needed to add some application specific logic, so I
extended AuthenticationService.cfc and referred to the extending cfc in
my services.xml. Now nothing works. :(

There seem to be 2 issues here:

- AuthenticationService.cfc (the original) has an init method that takes
some arguments, which are kindly supplied by coldspring. If I put in
ExtendedAuthenticationService.cfc, which doesn't override the init
method, colspring seems to think there's no more init method and
therefore the arguments aren't provided.
If I override the init method with an init method that contains nothing
but super.init(argumentCollection=arguments), it works again. Though
something tells me I shouldn't have to do this extra step.

- Second issue: every other component that receives
AuthenticationService as an argument from coldspring, doesn't receive
the extended version. I assume there's some type checking going on in
coldspring, before providing an argument. So I guess extended cfc's are
not accounted for here.

Hope someone can help me out here.

Regards,
Ruud Hermans




Reply via email to